~bzr/ubuntu/lucid/bzr/beta-ppa

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Martin Pool
  • Date: 2010-08-18 04:26:39 UTC
  • mfrom: (129.1.8 packaging-karmic)
  • Revision ID: mbp@sourcefrog.net-20100818042639-mjoxtngyjwiu05fo
* PPA rebuild for lucid.
* PPA rebuild for karmic.
* PPA rebuild onto jaunty.
* New upstream release.

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
 
1179
1174
 
1180
1175
class InvalidRevisionSpec(BzrError):
1181
1176
 
1182
 
    _fmt = ("Requested revision: %(spec)r does not exist in branch:"
 
1177
    _fmt = ("Requested revision: '%(spec)s' does not exist in branch:"
1183
1178
            " %(branch)s%(extra)s")
1184
1179
 
1185
1180
    def __init__(self, spec, branch, extra=None):
1297
1292
class BoundBranchOutOfDate(BzrError):
1298
1293
 
1299
1294
    _fmt = ("Bound branch %(branch)s is out of date with master branch"
1300
 
            " %(master)s.")
 
1295
            " %(master)s.%(extra_help)s")
1301
1296
 
1302
1297
    def __init__(self, branch, master):
1303
1298
        BzrError.__init__(self)
1304
1299
        self.branch = branch
1305
1300
        self.master = master
 
1301
        self.extra_help = ''
1306
1302
 
1307
1303
 
1308
1304
class CommitToDoubleBoundBranch(BzrError):
1379
1375
 
1380
1376
class WeaveParentMismatch(WeaveError):
1381
1377
 
1382
 
    _fmt = "Parents are mismatched between two revisions. %(message)s"
 
1378
    _fmt = "Parents are mismatched between two revisions. %(msg)s"
1383
1379
 
1384
1380
 
1385
1381
class WeaveInvalidChecksum(WeaveError):
1386
1382
 
1387
 
    _fmt = "Text did not match it's checksum: %(message)s"
 
1383
    _fmt = "Text did not match it's checksum: %(msg)s"
1388
1384
 
1389
1385
 
1390
1386
class WeaveTextDiffers(WeaveError):
1438
1434
 
1439
1435
class VersionedFileInvalidChecksum(VersionedFileError):
1440
1436
 
1441
 
    _fmt = "Text did not match its checksum: %(message)s"
 
1437
    _fmt = "Text did not match its checksum: %(msg)s"
1442
1438
 
1443
1439
 
1444
1440
class KnitError(InternalBzrError):
1924
1920
    _fmt = "Moving the root directory is not supported at this time"
1925
1921
 
1926
1922
 
 
1923
class TransformRenameFailed(BzrError):
 
1924
 
 
1925
    _fmt = "Failed to rename %(from_path)s to %(to_path)s: %(why)s"
 
1926
 
 
1927
    def __init__(self, from_path, to_path, why, errno):
 
1928
        self.from_path = from_path
 
1929
        self.to_path = to_path
 
1930
        self.why = why
 
1931
        self.errno = errno
 
1932
 
 
1933
 
1927
1934
class BzrMoveFailedError(BzrError):
1928
1935
 
1929
1936
    _fmt = "Could not move %(from_path)s%(operator)s %(to_path)s%(extra)s"
2175
2182
 
2176
2183
    def __init__(self, repo):
2177
2184
        BzrError.__init__(self)
2178
 
        self.repo_path = repo.bzrdir.root_transport.base
 
2185
        self.repo_path = repo.user_url
2179
2186
 
2180
2187
 
2181
2188
class InconsistentDelta(BzrError):
2753
2760
 
2754
2761
    def __init__(self, bzrdir):
2755
2762
        import bzrlib.urlutils as urlutils
2756
 
        display_url = urlutils.unescape_for_display(bzrdir.root_transport.base,
 
2763
        display_url = urlutils.unescape_for_display(bzrdir.user_url,
2757
2764
                                                    'ascii')
2758
2765
        BzrError.__init__(self, bzrdir=bzrdir, display_url=display_url)
2759
2766
 
2834
2841
            more = ' ' + more
2835
2842
        import bzrlib.urlutils as urlutils
2836
2843
        display_url = urlutils.unescape_for_display(
2837
 
            tree.bzrdir.root_transport.base, 'ascii')
 
2844
            tree.user_url, 'ascii')
2838
2845
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2839
2846
 
2840
2847
 
 
2848
class ShelvedChanges(UncommittedChanges):
 
2849
 
 
2850
    _fmt = ('Working tree "%(display_url)s" has shelved changes'
 
2851
            ' (See bzr shelve --list).%(more)s')
 
2852
 
 
2853
 
2841
2854
class MissingTemplateVariable(BzrError):
2842
2855
 
2843
2856
    _fmt = 'Variable {%(name)s} is not available.'
3124
3137
 
3125
3138
    def __init__(self, path):
3126
3139
        self.path = path
 
3140
 
 
3141
 
 
3142
class NoColocatedBranchSupport(BzrError):
 
3143
 
 
3144
    _fmt = ("%(bzrdir)r does not support co-located branches.")
 
3145
 
 
3146
    def __init__(self, bzrdir):
 
3147
        self.bzrdir = bzrdir
 
3148
 
 
3149
 
 
3150
class NoWhoami(BzrError):
 
3151
 
 
3152
    _fmt = ('Unable to determine your name.\n'
 
3153
        "Please, set your name with the 'whoami' command.\n"
 
3154
        'E.g. bzr whoami "Your Name <name@example.com>"')
 
3155
 
 
3156
 
 
3157
class InvalidPattern(BzrError):
 
3158
 
 
3159
    _fmt = ('Invalid pattern(s) found. %(msg)s')
 
3160
 
 
3161
    def __init__(self, msg):
 
3162
        self.msg = msg
 
3163
 
 
3164
 
 
3165
class RecursiveBind(BzrError):
 
3166
 
 
3167
    _fmt = ('Branch "%(branch_url)s" appears to be bound to itself. '
 
3168
        'Please use `bzr unbind` to fix.')
 
3169
 
 
3170
    def __init__(self, branch_url):
 
3171
        self.branch_url = branch_url
 
3172