/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: Marius Kruger
  • Date: 2010-08-15 04:52:51 UTC
  • mfrom: (5376 +trunk)
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100815045251-izmea8nn05thhrok
merge with bzr.dev

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 = True
 
683
    internal_error = False
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)))
785
787
    def __init__(self, branch, path):
786
788
        BzrError.__init__(self)
787
789
        self.branch = branch
947
949
    # original exception is available as e.original_error
948
950
    #
949
951
    # 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
 
952
    def __init__(self, msg):
 
953
        self.msg = msg
955
954
 
956
955
 
957
956
class LockActive(LockError):
1178
1177
class InvalidRevisionSpec(BzrError):
1179
1178
 
1180
1179
    _fmt = ("Requested revision: '%(spec)s' does not exist in branch:"
1181
 
            " %(branch)s%(extra)s")
 
1180
            " %(branch_url)s%(extra)s")
1182
1181
 
1183
1182
    def __init__(self, spec, branch, extra=None):
1184
1183
        BzrError.__init__(self, branch=branch, spec=spec)
 
1184
        self.branch_url = getattr(branch, 'user_url', str(branch))
1185
1185
        if extra:
1186
1186
            self.extra = '\n' + str(extra)
1187
1187
        else:
1378
1378
 
1379
1379
class WeaveParentMismatch(WeaveError):
1380
1380
 
1381
 
    _fmt = "Parents are mismatched between two revisions. %(message)s"
 
1381
    _fmt = "Parents are mismatched between two revisions. %(msg)s"
1382
1382
 
1383
1383
 
1384
1384
class WeaveInvalidChecksum(WeaveError):
1385
1385
 
1386
 
    _fmt = "Text did not match it's checksum: %(message)s"
 
1386
    _fmt = "Text did not match it's checksum: %(msg)s"
1387
1387
 
1388
1388
 
1389
1389
class WeaveTextDiffers(WeaveError):
1437
1437
 
1438
1438
class VersionedFileInvalidChecksum(VersionedFileError):
1439
1439
 
1440
 
    _fmt = "Text did not match its checksum: %(message)s"
 
1440
    _fmt = "Text did not match its checksum: %(msg)s"
1441
1441
 
1442
1442
 
1443
1443
class KnitError(InternalBzrError):
2845
2845
        else:
2846
2846
            more = ' ' + more
2847
2847
        import bzrlib.urlutils as urlutils
2848
 
        display_url = urlutils.unescape_for_display(
2849
 
            tree.user_url, 'ascii')
 
2848
        user_url = getattr(tree, "user_url", None)
 
2849
        if user_url is None:
 
2850
            display_url = str(tree)
 
2851
        else:
 
2852
            display_url = urlutils.unescape_for_display(user_url, 'ascii')
2850
2853
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2851
2854
 
2852
2855
 
3151
3154
    def __init__(self, bzrdir):
3152
3155
        self.bzrdir = bzrdir
3153
3156
 
 
3157
 
3154
3158
class NoWhoami(BzrError):
3155
3159
 
3156
3160
    _fmt = ('Unable to determine your name.\n'
3157
3161
        "Please, set your name with the 'whoami' command.\n"
3158
3162
        'E.g. bzr whoami "Your Name <name@example.com>"')
3159
3163
 
 
3164
 
3160
3165
class InvalidPattern(BzrError):
3161
3166
 
3162
3167
    _fmt = ('Invalid pattern(s) found. %(msg)s')
3164
3169
    def __init__(self, msg):
3165
3170
        self.msg = msg
3166
3171
 
 
3172
 
 
3173
class RecursiveBind(BzrError):
 
3174
 
 
3175
    _fmt = ('Branch "%(branch_url)s" appears to be bound to itself. '
 
3176
        'Please use `bzr unbind` to fix.')
 
3177
 
 
3178
    def __init__(self, branch_url):
 
3179
        self.branch_url = branch_url
 
3180