/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: Vincent Ladeuil
  • Date: 2010-09-30 08:49:08 UTC
  • mto: (5050.17.28 2.2)
  • mto: This revision was merged to the branch mainline in revision 5474.
  • Revision ID: v.ladeuil+lp@free.fr-20100930084908-jyz8y77ybwlu0ae4
tests/ssl_certs/ca.crt is needed for running https tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
947
947
    # original exception is available as e.original_error
948
948
    #
949
949
    # New code should prefer to raise specific subclasses
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
 
950
    def __init__(self, msg):
 
951
        self.msg = msg
955
952
 
956
953
 
957
954
class LockActive(LockError):
1041
1038
class LockContention(LockError):
1042
1039
 
1043
1040
    _fmt = 'Could not acquire lock "%(lock)s": %(msg)s'
1044
 
    # TODO: show full url for lock, combining the transport and relative
1045
 
    # bits?
1046
1041
 
1047
1042
    internal_error = False
1048
1043
 
1075
1070
        self.target = target
1076
1071
 
1077
1072
 
 
1073
class LockCorrupt(LockError):
 
1074
 
 
1075
    _fmt = ("Lock is apparently held, but corrupted: %(corruption_info)s\n"
 
1076
            "Use 'bzr break-lock' to clear it")
 
1077
 
 
1078
    internal_error = False
 
1079
 
 
1080
    def __init__(self, corruption_info, file_data=None):
 
1081
        self.corruption_info = corruption_info
 
1082
        self.file_data = file_data
 
1083
 
 
1084
 
1078
1085
class LockNotHeld(LockError):
1079
1086
 
1080
1087
    _fmt = "Lock not held: %(lock)s"
1380
1387
 
1381
1388
class WeaveParentMismatch(WeaveError):
1382
1389
 
1383
 
    _fmt = "Parents are mismatched between two revisions. %(message)s"
 
1390
    _fmt = "Parents are mismatched between two revisions. %(msg)s"
1384
1391
 
1385
1392
 
1386
1393
class WeaveInvalidChecksum(WeaveError):
1387
1394
 
1388
 
    _fmt = "Text did not match it's checksum: %(message)s"
 
1395
    _fmt = "Text did not match it's checksum: %(msg)s"
1389
1396
 
1390
1397
 
1391
1398
class WeaveTextDiffers(WeaveError):
1439
1446
 
1440
1447
class VersionedFileInvalidChecksum(VersionedFileError):
1441
1448
 
1442
 
    _fmt = "Text did not match its checksum: %(message)s"
 
1449
    _fmt = "Text did not match its checksum: %(msg)s"
1443
1450
 
1444
1451
 
1445
1452
class KnitError(InternalBzrError):
1925
1932
    _fmt = "Moving the root directory is not supported at this time"
1926
1933
 
1927
1934
 
 
1935
class TransformRenameFailed(BzrError):
 
1936
 
 
1937
    _fmt = "Failed to rename %(from_path)s to %(to_path)s: %(why)s"
 
1938
 
 
1939
    def __init__(self, from_path, to_path, why, errno):
 
1940
        self.from_path = from_path
 
1941
        self.to_path = to_path
 
1942
        self.why = why
 
1943
        self.errno = errno
 
1944
 
 
1945
 
1928
1946
class BzrMoveFailedError(BzrError):
1929
1947
 
1930
1948
    _fmt = "Could not move %(from_path)s%(operator)s %(to_path)s%(extra)s"
2839
2857
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2840
2858
 
2841
2859
 
 
2860
class ShelvedChanges(UncommittedChanges):
 
2861
 
 
2862
    _fmt = ('Working tree "%(display_url)s" has shelved changes'
 
2863
            ' (See bzr shelve --list).%(more)s')
 
2864
 
 
2865
 
2842
2866
class MissingTemplateVariable(BzrError):
2843
2867
 
2844
2868
    _fmt = 'Variable {%(name)s} is not available.'
3134
3158
    def __init__(self, bzrdir):
3135
3159
        self.bzrdir = bzrdir
3136
3160
 
 
3161
 
 
3162
class NoWhoami(BzrError):
 
3163
 
 
3164
    _fmt = ('Unable to determine your name.\n'
 
3165
        "Please, set your name with the 'whoami' command.\n"
 
3166
        'E.g. bzr whoami "Your Name <name@example.com>"')
 
3167
 
 
3168
 
 
3169
class InvalidPattern(BzrError):
 
3170
 
 
3171
    _fmt = ('Invalid pattern(s) found. %(msg)s')
 
3172
 
 
3173
    def __init__(self, msg):
 
3174
        self.msg = msg
 
3175
 
 
3176
 
 
3177
class RecursiveBind(BzrError):
 
3178
 
 
3179
    _fmt = ('Branch "%(branch_url)s" appears to be bound to itself. '
 
3180
        'Please use `bzr unbind` to fix.')
 
3181
 
 
3182
    def __init__(self, branch_url):
 
3183
        self.branch_url = branch_url
 
3184