/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-12-20 12:34:06 UTC
  • mfrom: (3133 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3134.
  • Revision ID: john@arbash-meinel.com-20071220123406-4ijq232s46ecsutz
[merge] bzr.dev 3133

Show diffs side-by-side

added added

removed removed

Lines of Context:
252
252
        self.revision_id = revision_id
253
253
        self.branch = branch
254
254
 
 
255
 
255
256
class ReservedId(BzrError):
256
257
 
257
258
    _fmt = "Reserved revision-id {%(revision_id)s}"
470
471
    """Used when renaming and both source and dest exist."""
471
472
 
472
473
    _fmt = ("Could not rename %(source)s => %(dest)s because both files exist."
473
 
            "%(extra)s")
 
474
            " (Use --after to tell bzr about a rename that has already"
 
475
            " happened)%(extra)s")
474
476
 
475
477
    def __init__(self, source, dest, extra=None):
476
478
        BzrError.__init__(self)
651
653
 
652
654
class FileInWrongBranch(BzrError):
653
655
 
654
 
    _fmt = 'File "%(path)s" in not in branch %(branch_base)s.'
 
656
    _fmt = 'File "%(path)s" is not in branch %(branch_base)s.'
655
657
 
656
658
    def __init__(self, branch, path):
657
659
        BzrError.__init__(self)
1099
1101
            " no merge base revision was specified.")
1100
1102
 
1101
1103
 
 
1104
class CannotReverseCherrypick(BzrError):
 
1105
 
 
1106
    _fmt = ('Selected merge cannot perform reverse cherrypicks.  Try merge3'
 
1107
            ' or diff3.')
 
1108
 
 
1109
 
1102
1110
class NoCommonAncestor(BzrError):
1103
1111
    
1104
1112
    _fmt = "Revisions have no common ancestor: %(revision_a)s %(revision_b)s"
1330
1338
 
1331
1339
 
1332
1340
class KnitDataStreamIncompatible(KnitError):
 
1341
    # Not raised anymore, as we can convert data streams.  In future we may
 
1342
    # need it again for more exotic cases, so we're keeping it around for now.
1333
1343
 
1334
1344
    _fmt = "Cannot insert knit data stream of format \"%(stream_format)s\" into knit of format \"%(target_format)s\"."
1335
1345
 
1338
1348
        self.target_format = target_format
1339
1349
        
1340
1350
 
 
1351
class KnitDataStreamUnknown(KnitError):
 
1352
    # Indicates a data stream we don't know how to handle.
 
1353
 
 
1354
    _fmt = "Cannot parse knit data stream of format \"%(stream_format)s\"."
 
1355
 
 
1356
    def __init__(self, stream_format):
 
1357
        self.stream_format = stream_format
 
1358
        
 
1359
 
1341
1360
class KnitHeaderError(KnitError):
1342
1361
 
1343
1362
    _fmt = 'Knit header error: %(badline)r unexpected for file "%(filename)s".'
1442
1461
 
1443
1462
class InvalidRange(TransportError):
1444
1463
 
1445
 
    _fmt = "Invalid range access in %(path)s at %(offset)s."
1446
 
    
1447
 
    def __init__(self, path, offset):
1448
 
        TransportError.__init__(self, ("Invalid range access in %s at %d"
1449
 
                                       % (path, offset)))
 
1464
    _fmt = "Invalid range access in %(path)s at %(offset)s: %(msg)s"
 
1465
 
 
1466
    def __init__(self, path, offset, msg=None):
 
1467
        TransportError.__init__(self, msg)
1450
1468
        self.path = path
1451
1469
        self.offset = offset
1452
1470
 
1463
1481
class InvalidHttpRange(InvalidHttpResponse):
1464
1482
 
1465
1483
    _fmt = "Invalid http range %(range)r for %(path)s: %(msg)s"
1466
 
    
 
1484
 
1467
1485
    def __init__(self, path, range, msg):
1468
1486
        self.range = range
1469
1487
        InvalidHttpResponse.__init__(self, path, msg)
1472
1490
class InvalidHttpContentType(InvalidHttpResponse):
1473
1491
 
1474
1492
    _fmt = 'Invalid http Content-type "%(ctype)s" for %(path)s: %(msg)s'
1475
 
    
 
1493
 
1476
1494
    def __init__(self, path, ctype, msg):
1477
1495
        self.ctype = ctype
1478
1496
        InvalidHttpResponse.__init__(self, path, msg)
1844
1862
        self.format = format
1845
1863
 
1846
1864
 
 
1865
class NoDiffFound(BzrError):
 
1866
 
 
1867
    _fmt = 'Could not find an appropriate Differ for file "%(path)s"'
 
1868
 
 
1869
    def __init__(self, path):
 
1870
        BzrError.__init__(self, path)
 
1871
 
 
1872
 
1847
1873
class NoDiff(BzrError):
1848
1874
 
1849
1875
    _fmt = "Diff is not installed on this machine: %(msg)s"
1897
1923
 
1898
1924
class ImmortalPendingDeletion(BzrError):
1899
1925
 
1900
 
    _fmt = """Unable to delete transform temporary directory
1901
 
    %(pending_deletion)s.  Please examine %(pending_deletions)s to see if it
1902
 
    contains any files you wish to keep, and delete it when you are done."""
 
1926
    _fmt = ("Unable to delete transform temporary directory "
 
1927
    "%(pending_deletion)s.  Please examine %(pending_deletion)s to see if it "
 
1928
    "contains any files you wish to keep, and delete it when you are done.")
1903
1929
 
1904
1930
    def __init__(self, pending_deletion):
1905
1931
       BzrError.__init__(self, pending_deletion=pending_deletion)
2278
2304
        self.reason = reason
2279
2305
 
2280
2306
 
 
2307
class InvalidBugTrackerURL(BzrError):
 
2308
 
 
2309
    _fmt = ("The URL for bug tracker \"%(abbreviation)s\" doesn't "
 
2310
            "contain {id}: %(url)s")
 
2311
 
 
2312
    def __init__(self, abbreviation, url):
 
2313
        self.abbreviation = abbreviation
 
2314
        self.url = url
 
2315
 
 
2316
 
2281
2317
class UnknownBugTrackerAbbreviation(BzrError):
2282
2318
 
2283
2319
    _fmt = ("Cannot find registered bug tracker called %(abbreviation)s "
2371
2407
    _fmt = "No message supplied."
2372
2408
 
2373
2409
 
 
2410
class NoMailAddressSpecified(BzrError):
 
2411
 
 
2412
    _fmt = "No mail-to address specified."
 
2413
 
 
2414
 
2374
2415
class UnknownMailClient(BzrError):
2375
2416
 
2376
2417
    _fmt = "Unknown mail client: %(mail_client)s"
2427
2468
    _fmt = "'%(display_url)s' is already a checkout."
2428
2469
 
2429
2470
 
 
2471
class AlreadyLightweightCheckout(BzrDirError):
 
2472
 
 
2473
    _fmt = "'%(display_url)s' is already a lightweight checkout."
 
2474
 
 
2475
 
2430
2476
class ReconfigurationNotSupported(BzrDirError):
2431
2477
 
2432
2478
    _fmt = "Requested reconfiguration of '%(display_url)s' is not supported."
2446
2492
        display_url = urlutils.unescape_for_display(
2447
2493
            tree.bzrdir.root_transport.base, 'ascii')
2448
2494
        BzrError.__init__(self, tree=tree, display_url=display_url)
 
2495
 
 
2496
 
 
2497
class MissingTemplateVariable(BzrError):
 
2498
 
 
2499
    _fmt = 'Variable {%(name)s} is not available.'
 
2500
 
 
2501
    def __init__(self, name):
 
2502
        self.name = name
 
2503
 
 
2504
 
 
2505
class UnableCreateSymlink(BzrError):
 
2506
 
 
2507
    _fmt = 'Unable to create symlink %(path_str)son this platform'
 
2508
 
 
2509
    def __init__(self, path=None):
 
2510
        path_str = ''
 
2511
        if path:
 
2512
            try:
 
2513
                path_str = repr(str(path))
 
2514
            except UnicodeEncodeError:
 
2515
                path_str = repr(path)
 
2516
            path_str += ' '
 
2517
        self.path_str = path_str