/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: Robert Collins
  • Date: 2008-02-13 03:30:01 UTC
  • mfrom: (3221 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3224.
  • Revision ID: robertc@robertcollins.net-20080213033001-rw70ul0zb02ph856
Merge to fix conflicts.

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}"
266
267
        "record_entry_contents.")
267
268
 
268
269
 
 
270
class NoPublicBranch(BzrError):
 
271
 
 
272
    _fmt = 'There is no public branch set for "%(branch_url)s".'
 
273
 
 
274
    def __init__(self, branch):
 
275
        import bzrlib.urlutils as urlutils
 
276
        public_location = urlutils.unescape_for_display(branch.base, 'ascii')
 
277
        BzrError.__init__(self, branch_url=public_location)
 
278
 
 
279
 
269
280
class NoHelpTopic(BzrError):
270
281
 
271
282
    _fmt = ("No help could be found for '%(topic)s'. "
652
663
 
653
664
class FileInWrongBranch(BzrError):
654
665
 
655
 
    _fmt = 'File "%(path)s" in not in branch %(branch_base)s.'
 
666
    _fmt = 'File "%(path)s" is not in branch %(branch_base)s.'
656
667
 
657
668
    def __init__(self, branch, path):
658
669
        BzrError.__init__(self)
1100
1111
            " no merge base revision was specified.")
1101
1112
 
1102
1113
 
 
1114
class CannotReverseCherrypick(BzrError):
 
1115
 
 
1116
    _fmt = ('Selected merge cannot perform reverse cherrypicks.  Try merge3'
 
1117
            ' or diff3.')
 
1118
 
 
1119
 
1103
1120
class NoCommonAncestor(BzrError):
1104
1121
    
1105
1122
    _fmt = "Revisions have no common ancestor: %(revision_a)s %(revision_b)s"
1331
1348
 
1332
1349
 
1333
1350
class KnitDataStreamIncompatible(KnitError):
 
1351
    # Not raised anymore, as we can convert data streams.  In future we may
 
1352
    # need it again for more exotic cases, so we're keeping it around for now.
1334
1353
 
1335
1354
    _fmt = "Cannot insert knit data stream of format \"%(stream_format)s\" into knit of format \"%(target_format)s\"."
1336
1355
 
1339
1358
        self.target_format = target_format
1340
1359
        
1341
1360
 
 
1361
class KnitDataStreamUnknown(KnitError):
 
1362
    # Indicates a data stream we don't know how to handle.
 
1363
 
 
1364
    _fmt = "Cannot parse knit data stream of format \"%(stream_format)s\"."
 
1365
 
 
1366
    def __init__(self, stream_format):
 
1367
        self.stream_format = stream_format
 
1368
        
 
1369
 
1342
1370
class KnitHeaderError(KnitError):
1343
1371
 
1344
1372
    _fmt = 'Knit header error: %(badline)r unexpected for file "%(filename)s".'
1443
1471
 
1444
1472
class InvalidRange(TransportError):
1445
1473
 
1446
 
    _fmt = "Invalid range access in %(path)s at %(offset)s."
1447
 
    
1448
 
    def __init__(self, path, offset):
1449
 
        TransportError.__init__(self, ("Invalid range access in %s at %d"
1450
 
                                       % (path, offset)))
 
1474
    _fmt = "Invalid range access in %(path)s at %(offset)s: %(msg)s"
 
1475
 
 
1476
    def __init__(self, path, offset, msg=None):
 
1477
        TransportError.__init__(self, msg)
1451
1478
        self.path = path
1452
1479
        self.offset = offset
1453
1480
 
1464
1491
class InvalidHttpRange(InvalidHttpResponse):
1465
1492
 
1466
1493
    _fmt = "Invalid http range %(range)r for %(path)s: %(msg)s"
1467
 
    
 
1494
 
1468
1495
    def __init__(self, path, range, msg):
1469
1496
        self.range = range
1470
1497
        InvalidHttpResponse.__init__(self, path, msg)
1473
1500
class InvalidHttpContentType(InvalidHttpResponse):
1474
1501
 
1475
1502
    _fmt = 'Invalid http Content-type "%(ctype)s" for %(path)s: %(msg)s'
1476
 
    
 
1503
 
1477
1504
    def __init__(self, path, ctype, msg):
1478
1505
        self.ctype = ctype
1479
1506
        InvalidHttpResponse.__init__(self, path, msg)
1845
1872
        self.format = format
1846
1873
 
1847
1874
 
 
1875
class NoDiffFound(BzrError):
 
1876
 
 
1877
    _fmt = 'Could not find an appropriate Differ for file "%(path)s"'
 
1878
 
 
1879
    def __init__(self, path):
 
1880
        BzrError.__init__(self, path)
 
1881
 
 
1882
 
 
1883
class ExecutableMissing(BzrError):
 
1884
 
 
1885
    _fmt = "%(exe_name)s could not be found on this machine"
 
1886
 
 
1887
    def __init__(self, exe_name):
 
1888
        BzrError.__init__(self, exe_name=exe_name)
 
1889
 
 
1890
 
1848
1891
class NoDiff(BzrError):
1849
1892
 
1850
1893
    _fmt = "Diff is not installed on this machine: %(msg)s"
2279
2322
        self.reason = reason
2280
2323
 
2281
2324
 
 
2325
class InvalidBugTrackerURL(BzrError):
 
2326
 
 
2327
    _fmt = ("The URL for bug tracker \"%(abbreviation)s\" doesn't "
 
2328
            "contain {id}: %(url)s")
 
2329
 
 
2330
    def __init__(self, abbreviation, url):
 
2331
        self.abbreviation = abbreviation
 
2332
        self.url = url
 
2333
 
 
2334
 
2282
2335
class UnknownBugTrackerAbbreviation(BzrError):
2283
2336
 
2284
2337
    _fmt = ("Cannot find registered bug tracker called %(abbreviation)s "
2372
2425
    _fmt = "No message supplied."
2373
2426
 
2374
2427
 
 
2428
class NoMailAddressSpecified(BzrError):
 
2429
 
 
2430
    _fmt = "No mail-to address specified."
 
2431
 
 
2432
 
2375
2433
class UnknownMailClient(BzrError):
2376
2434
 
2377
2435
    _fmt = "Unknown mail client: %(mail_client)s"
2428
2486
    _fmt = "'%(display_url)s' is already a checkout."
2429
2487
 
2430
2488
 
 
2489
class AlreadyLightweightCheckout(BzrDirError):
 
2490
 
 
2491
    _fmt = "'%(display_url)s' is already a lightweight checkout."
 
2492
 
 
2493
 
2431
2494
class ReconfigurationNotSupported(BzrDirError):
2432
2495
 
2433
2496
    _fmt = "Requested reconfiguration of '%(display_url)s' is not supported."
2447
2510
        display_url = urlutils.unescape_for_display(
2448
2511
            tree.bzrdir.root_transport.base, 'ascii')
2449
2512
        BzrError.__init__(self, tree=tree, display_url=display_url)
 
2513
 
 
2514
 
 
2515
class MissingTemplateVariable(BzrError):
 
2516
 
 
2517
    _fmt = 'Variable {%(name)s} is not available.'
 
2518
 
 
2519
    def __init__(self, name):
 
2520
        self.name = name
 
2521
 
 
2522
 
 
2523
class NoTemplate(BzrError):
 
2524
 
 
2525
    _fmt = 'No template specified.'
 
2526
 
 
2527
 
 
2528
class UnableCreateSymlink(BzrError):
 
2529
 
 
2530
    _fmt = 'Unable to create symlink %(path_str)son this platform'
 
2531
 
 
2532
    def __init__(self, path=None):
 
2533
        path_str = ''
 
2534
        if path:
 
2535
            try:
 
2536
                path_str = repr(str(path))
 
2537
            except UnicodeEncodeError:
 
2538
                path_str = repr(path)
 
2539
            path_str += ' '
 
2540
        self.path_str = path_str
 
2541
 
 
2542
 
 
2543
class UnsupportedTimezoneFormat(BzrError):
 
2544
 
 
2545
    _fmt = ('Unsupported timezone format "%(timezone)s", '
 
2546
            'options are "utc", "original", "local".')
 
2547
 
 
2548
    def __init__(self, timezone):
 
2549
        self.timezone = timezone