/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: John Arbash Meinel
  • Date: 2007-03-22 19:54:30 UTC
  • mfrom: (2371 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2373.
  • Revision ID: john@arbash-meinel.com-20070322195430-wi92c7jpx17kiagr
[merge] bzr.dev 2371

Show diffs side-by-side

added added

removed removed

Lines of Context:
471
471
       self.path = urlutils.unescape_for_display(path, 'ascii')
472
472
 
473
473
 
 
474
class NoSubmitBranch(PathError):
 
475
 
 
476
    _fmt = 'No submit branch available for branch "%(path)s"'
 
477
 
 
478
    def __init__(self, branch):
 
479
       import bzrlib.urlutils as urlutils
 
480
       self.path = urlutils.unescape_for_display(branch.base, 'ascii')
 
481
 
 
482
 
474
483
class AlreadyBranchError(PathError):
475
484
 
476
485
    _fmt = "Already a branch: %(path)s."
638
647
 
639
648
class LockError(BzrError):
640
649
 
641
 
    _fmt = "Lock error: %(message)s"
 
650
    _fmt = "Lock error: %(msg)s"
642
651
 
643
652
    internal_error = True
644
653
 
648
657
    #
649
658
    # New code should prefer to raise specific subclasses
650
659
    def __init__(self, message):
651
 
        self.message = message
 
660
        # Python 2.5 uses a slot for StandardError.message,
 
661
        # so use a different variable name
 
662
        # so it is exposed in self.__dict__
 
663
        self.msg = message
652
664
 
653
665
 
654
666
class LockActive(LockError):
688
700
        self.obj = obj
689
701
 
690
702
 
 
703
class ReadOnlyLockError(LockError):
 
704
 
 
705
    _fmt = "Cannot acquire write lock on %(fname)s. %(msg)s"
 
706
 
 
707
    def __init__(self, fname, msg):
 
708
        LockError.__init__(self, '')
 
709
        self.fname = fname
 
710
        self.msg = msg
 
711
 
 
712
 
691
713
class OutSideTransaction(BzrError):
692
714
 
693
715
    _fmt = ("A transaction related operation was attempted after"
728
750
    # bits?
729
751
 
730
752
    internal_error = False
731
 
    
 
753
 
732
754
    def __init__(self, lock):
733
755
        self.lock = lock
734
756
 
1867
1889
        self.name = name
1868
1890
 
1869
1891
 
 
1892
class NotAMergeDirective(BzrError):
 
1893
    """File starting with %(firstline)r is not a merge directive"""
 
1894
    def __init__(self, firstline):
 
1895
        BzrError.__init__(self, firstline=firstline)
 
1896
 
 
1897
 
1870
1898
class NoMergeSource(BzrError):
1871
1899
    """Raise if no merge source was specified for a merge directive"""
1872
1900