/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: Robert Collins
  • Date: 2010-05-06 11:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506110810-h3j07fh5gmw54s25
Cleaner matcher matching revised unlocking protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
680
680
 
681
681
    _fmt = 'Path "%(path)s" is not a child of path "%(base)s"%(extra)s'
682
682
 
683
 
    internal_error = False
 
683
    internal_error = True
684
684
 
685
685
    def __init__(self, path, base, extra=None):
686
686
        BzrError.__init__(self)
782
782
 
783
783
    _fmt = 'File "%(path)s" is not in branch %(branch_base)s.'
784
784
 
785
 
    # use PathNotChild instead
786
 
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 3, 0)))
787
785
    def __init__(self, branch, path):
788
786
        BzrError.__init__(self)
789
787
        self.branch = branch
949
947
    # original exception is available as e.original_error
950
948
    #
951
949
    # New code should prefer to raise specific subclasses
952
 
    def __init__(self, msg):
953
 
        self.msg = msg
 
950
    def __init__(self, message):
 
951
        # Python 2.5 uses a slot for StandardError.message,
 
952
        # so use a different variable name.  We now work around this in
 
953
        # BzrError.__str__, but this member name is kept for compatability.
 
954
        self.msg = message
954
955
 
955
956
 
956
957
class LockActive(LockError):
1040
1041
class LockContention(LockError):
1041
1042
 
1042
1043
    _fmt = 'Could not acquire lock "%(lock)s": %(msg)s'
 
1044
    # TODO: show full url for lock, combining the transport and relative
 
1045
    # bits?
1043
1046
 
1044
1047
    internal_error = False
1045
1048
 
1177
1180
class InvalidRevisionSpec(BzrError):
1178
1181
 
1179
1182
    _fmt = ("Requested revision: '%(spec)s' does not exist in branch:"
1180
 
            " %(branch_url)s%(extra)s")
 
1183
            " %(branch)s%(extra)s")
1181
1184
 
1182
1185
    def __init__(self, spec, branch, extra=None):
1183
1186
        BzrError.__init__(self, branch=branch, spec=spec)
1184
 
        self.branch_url = getattr(branch, 'user_url', str(branch))
1185
1187
        if extra:
1186
1188
            self.extra = '\n' + str(extra)
1187
1189
        else:
1378
1380
 
1379
1381
class WeaveParentMismatch(WeaveError):
1380
1382
 
1381
 
    _fmt = "Parents are mismatched between two revisions. %(msg)s"
 
1383
    _fmt = "Parents are mismatched between two revisions. %(message)s"
1382
1384
 
1383
1385
 
1384
1386
class WeaveInvalidChecksum(WeaveError):
1385
1387
 
1386
 
    _fmt = "Text did not match it's checksum: %(msg)s"
 
1388
    _fmt = "Text did not match it's checksum: %(message)s"
1387
1389
 
1388
1390
 
1389
1391
class WeaveTextDiffers(WeaveError):
1437
1439
 
1438
1440
class VersionedFileInvalidChecksum(VersionedFileError):
1439
1441
 
1440
 
    _fmt = "Text did not match its checksum: %(msg)s"
 
1442
    _fmt = "Text did not match its checksum: %(message)s"
1441
1443
 
1442
1444
 
1443
1445
class KnitError(InternalBzrError):
1923
1925
    _fmt = "Moving the root directory is not supported at this time"
1924
1926
 
1925
1927
 
1926
 
class TransformRenameFailed(BzrError):
1927
 
 
1928
 
    _fmt = "Failed to rename %(from_path)s to %(to_path)s: %(why)s"
1929
 
 
1930
 
    def __init__(self, from_path, to_path, why, errno):
1931
 
        self.from_path = from_path
1932
 
        self.to_path = to_path
1933
 
        self.why = why
1934
 
        self.errno = errno
1935
 
 
1936
 
 
1937
1928
class BzrMoveFailedError(BzrError):
1938
1929
 
1939
1930
    _fmt = "Could not move %(from_path)s%(operator)s %(to_path)s%(extra)s"
2843
2834
        else:
2844
2835
            more = ' ' + more
2845
2836
        import bzrlib.urlutils as urlutils
2846
 
        user_url = getattr(tree, "user_url", None)
2847
 
        if user_url is None:
2848
 
            display_url = str(tree)
2849
 
        else:
2850
 
            display_url = urlutils.unescape_for_display(user_url, 'ascii')
 
2837
        display_url = urlutils.unescape_for_display(
 
2838
            tree.user_url, 'ascii')
2851
2839
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2852
2840
 
2853
2841
 
2854
 
class ShelvedChanges(UncommittedChanges):
2855
 
 
2856
 
    _fmt = ('Working tree "%(display_url)s" has shelved changes'
2857
 
            ' (See bzr shelve --list).%(more)s')
2858
 
 
2859
 
 
2860
2842
class MissingTemplateVariable(BzrError):
2861
2843
 
2862
2844
    _fmt = 'Variable {%(name)s} is not available.'
3152
3134
    def __init__(self, bzrdir):
3153
3135
        self.bzrdir = bzrdir
3154
3136
 
3155
 
 
3156
 
class NoWhoami(BzrError):
3157
 
 
3158
 
    _fmt = ('Unable to determine your name.\n'
3159
 
        "Please, set your name with the 'whoami' command.\n"
3160
 
        'E.g. bzr whoami "Your Name <name@example.com>"')
3161
 
 
3162
 
 
3163
 
class InvalidPattern(BzrError):
3164
 
 
3165
 
    _fmt = ('Invalid pattern(s) found. %(msg)s')
3166
 
 
3167
 
    def __init__(self, msg):
3168
 
        self.msg = msg
3169
 
 
3170
 
 
3171
 
class RecursiveBind(BzrError):
3172
 
 
3173
 
    _fmt = ('Branch "%(branch_url)s" appears to be bound to itself. '
3174
 
        'Please use `bzr unbind` to fix.')
3175
 
 
3176
 
    def __init__(self, branch_url):
3177
 
        self.branch_url = branch_url
3178