/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: Lukáš Lalinský
  • Date: 2007-12-17 17:28:25 UTC
  • mfrom: (3120 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3123.
  • Revision ID: lalinsky@gmail.com-20071217172825-tr3pqm1mhvs3gwnn
Merge bzr.dev.

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)
1330
1332
 
1331
1333
 
1332
1334
class KnitDataStreamIncompatible(KnitError):
 
1335
    # Not raised anymore, as we can convert data streams.  In future we may
 
1336
    # need it again for more exotic cases, so we're keeping it around for now.
1333
1337
 
1334
1338
    _fmt = "Cannot insert knit data stream of format \"%(stream_format)s\" into knit of format \"%(target_format)s\"."
1335
1339
 
1338
1342
        self.target_format = target_format
1339
1343
        
1340
1344
 
 
1345
class KnitDataStreamUnknown(KnitError):
 
1346
    # Indicates a data stream we don't know how to handle.
 
1347
 
 
1348
    _fmt = "Cannot parse knit data stream of format \"%(stream_format)s\"."
 
1349
 
 
1350
    def __init__(self, stream_format):
 
1351
        self.stream_format = stream_format
 
1352
        
 
1353
 
1341
1354
class KnitHeaderError(KnitError):
1342
1355
 
1343
1356
    _fmt = 'Knit header error: %(badline)r unexpected for file "%(filename)s".'
1442
1455
 
1443
1456
class InvalidRange(TransportError):
1444
1457
 
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)))
 
1458
    _fmt = "Invalid range access in %(path)s at %(offset)s: %(msg)s"
 
1459
 
 
1460
    def __init__(self, path, offset, msg=None):
 
1461
        TransportError.__init__(self, msg)
1450
1462
        self.path = path
1451
1463
        self.offset = offset
1452
1464
 
1463
1475
class InvalidHttpRange(InvalidHttpResponse):
1464
1476
 
1465
1477
    _fmt = "Invalid http range %(range)r for %(path)s: %(msg)s"
1466
 
    
 
1478
 
1467
1479
    def __init__(self, path, range, msg):
1468
1480
        self.range = range
1469
1481
        InvalidHttpResponse.__init__(self, path, msg)
1472
1484
class InvalidHttpContentType(InvalidHttpResponse):
1473
1485
 
1474
1486
    _fmt = 'Invalid http Content-type "%(ctype)s" for %(path)s: %(msg)s'
1475
 
    
 
1487
 
1476
1488
    def __init__(self, path, ctype, msg):
1477
1489
        self.ctype = ctype
1478
1490
        InvalidHttpResponse.__init__(self, path, msg)
1844
1856
        self.format = format
1845
1857
 
1846
1858
 
 
1859
class NoDiffFound(BzrError):
 
1860
 
 
1861
    _fmt = 'Could not find an appropriate Differ for file "%(path)s"'
 
1862
 
 
1863
    def __init__(self, path):
 
1864
        BzrError.__init__(self, path)
 
1865
 
 
1866
 
1847
1867
class NoDiff(BzrError):
1848
1868
 
1849
1869
    _fmt = "Diff is not installed on this machine: %(msg)s"
1897
1917
 
1898
1918
class ImmortalPendingDeletion(BzrError):
1899
1919
 
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."""
 
1920
    _fmt = ("Unable to delete transform temporary directory "
 
1921
    "%(pending_deletion)s.  Please examine %(pending_deletion)s to see if it "
 
1922
    "contains any files you wish to keep, and delete it when you are done.")
1903
1923
 
1904
1924
    def __init__(self, pending_deletion):
1905
1925
       BzrError.__init__(self, pending_deletion=pending_deletion)
2278
2298
        self.reason = reason
2279
2299
 
2280
2300
 
 
2301
class InvalidBugTrackerURL(BzrError):
 
2302
 
 
2303
    _fmt = ("The URL for bug tracker \"%(abbreviation)s\" doesn't "
 
2304
            "contain {id}: %(url)s")
 
2305
 
 
2306
    def __init__(self, abbreviation, url):
 
2307
        self.abbreviation = abbreviation
 
2308
        self.url = url
 
2309
 
 
2310
 
2281
2311
class UnknownBugTrackerAbbreviation(BzrError):
2282
2312
 
2283
2313
    _fmt = ("Cannot find registered bug tracker called %(abbreviation)s "
2371
2401
    _fmt = "No message supplied."
2372
2402
 
2373
2403
 
 
2404
class NoMailAddressSpecified(BzrError):
 
2405
 
 
2406
    _fmt = "No mail-to address specified."
 
2407
 
 
2408
 
2374
2409
class UnknownMailClient(BzrError):
2375
2410
 
2376
2411
    _fmt = "Unknown mail client: %(mail_client)s"
2427
2462
    _fmt = "'%(display_url)s' is already a checkout."
2428
2463
 
2429
2464
 
 
2465
class AlreadyLightweightCheckout(BzrDirError):
 
2466
 
 
2467
    _fmt = "'%(display_url)s' is already a lightweight checkout."
 
2468
 
 
2469
 
2430
2470
class ReconfigurationNotSupported(BzrDirError):
2431
2471
 
2432
2472
    _fmt = "Requested reconfiguration of '%(display_url)s' is not supported."
2447
2487
            tree.bzrdir.root_transport.base, 'ascii')
2448
2488
        BzrError.__init__(self, tree=tree, display_url=display_url)
2449
2489
 
 
2490
 
2450
2491
class MissingTemplateVariable(BzrError):
2451
2492
 
2452
2493
    _fmt = 'Variable {%(name)s} is not available.'
2453
2494
 
2454
2495
    def __init__(self, name):
2455
2496
        self.name = name
 
2497
 
 
2498
 
 
2499
class UnableCreateSymlink(BzrError):
 
2500
 
 
2501
    _fmt = 'Unable to create symlink %(path_str)son this platform'
 
2502
 
 
2503
    def __init__(self, path=None):
 
2504
        path_str = ''
 
2505
        if path:
 
2506
            try:
 
2507
                path_str = repr(str(path))
 
2508
            except UnicodeEncodeError:
 
2509
                path_str = repr(path)
 
2510
            path_str += ' '
 
2511
        self.path_str = path_str