/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 breezy/errors.py

Move some more tests to breezy.bzr.

Merged from https://code.launchpad.net/~jelmer/brz/move-bzr-tests/+merge/386406

Show diffs side-by-side

added added

removed removed

Lines of Context:
250
250
    _fmt = "The branch '%(branch)s' is not stacked."
251
251
 
252
252
 
253
 
class InventoryModified(InternalBzrError):
254
 
 
255
 
    _fmt = ("The current inventory for the tree %(tree)r has been modified,"
256
 
            " so a clean inventory cannot be read without data loss.")
257
 
 
258
 
    def __init__(self, tree):
259
 
        self.tree = tree
260
 
 
261
 
 
262
253
class NoWorkingTree(BzrError):
263
254
 
264
255
    _fmt = 'No WorkingTree exists for "%(base)s".'
406
397
    _fmt = 'Permission denied: "%(path)s"%(extra)s'
407
398
 
408
399
 
409
 
class UnavailableRepresentation(InternalBzrError):
410
 
 
411
 
    _fmt = ("The encoding '%(wanted)s' is not available for key %(key)s which "
412
 
            "is encoded as '%(native)s'.")
413
 
 
414
 
    def __init__(self, key, wanted, native):
415
 
        InternalBzrError.__init__(self)
416
 
        self.wanted = wanted
417
 
        self.native = native
418
 
        self.key = key
419
 
 
420
 
 
421
400
class UnsupportedProtocol(PathError):
422
401
 
423
402
    _fmt = 'Unsupported protocol for url "%(path)s"%(extra)s'
1499
1478
        self.file_id = file_id
1500
1479
 
1501
1480
 
1502
 
class DuplicateFileId(BzrError):
1503
 
 
1504
 
    _fmt = "File id {%(file_id)s} already exists in inventory as %(entry)s"
1505
 
 
1506
 
    def __init__(self, file_id, entry):
1507
 
        BzrError.__init__(self)
1508
 
        self.file_id = file_id
1509
 
        self.entry = entry
1510
 
 
1511
 
 
1512
1481
class DuplicateKey(BzrError):
1513
1482
 
1514
1483
    _fmt = "Key %(key)s is already present in map"
1522
1491
        self.prefix = prefix
1523
1492
 
1524
1493
 
1525
 
class MalformedTransform(InternalBzrError):
1526
 
 
1527
 
    _fmt = "Tree transform is malformed %(conflicts)r"
1528
 
 
1529
 
 
1530
 
class NoFinalPath(BzrError):
1531
 
 
1532
 
    _fmt = ("No final name for trans_id %(trans_id)r\n"
1533
 
            "file-id: %(file_id)r\n"
1534
 
            "root trans-id: %(root_trans_id)r\n")
1535
 
 
1536
 
    def __init__(self, trans_id, transform):
1537
 
        self.trans_id = trans_id
1538
 
        self.file_id = transform.final_file_id(trans_id)
1539
 
        self.root_trans_id = transform.root
1540
 
 
1541
 
 
1542
1494
class BzrBadParameter(InternalBzrError):
1543
1495
 
1544
1496
    _fmt = "Bad parameter: %(param)r"
1556
1508
    _fmt = "Parameter %(param)s is neither unicode nor utf8."
1557
1509
 
1558
1510
 
1559
 
class ReusingTransform(BzrError):
1560
 
 
1561
 
    _fmt = "Attempt to reuse a transform that has already been applied."
1562
 
 
1563
 
 
1564
1511
class CantMoveRoot(BzrError):
1565
1512
 
1566
1513
    _fmt = "Moving the root directory is not supported at this time"
1706
1653
    _fmt = "Diff3 is not installed on this machine."
1707
1654
 
1708
1655
 
1709
 
class ExistingContent(BzrError):
1710
 
    # Added in breezy 0.92, used by VersionedFile.add_lines.
1711
 
 
1712
 
    _fmt = "The content being inserted is already present."
1713
 
 
1714
 
 
1715
1656
class ExistingLimbo(BzrError):
1716
1657
 
1717
1658
    _fmt = """This tree contains left-over files from a failed operation.
1733
1674
        BzrError.__init__(self, pending_deletion=pending_deletion)
1734
1675
 
1735
1676
 
1736
 
class ImmortalLimbo(BzrError):
1737
 
 
1738
 
    _fmt = """Unable to delete transform temporary directory %(limbo_dir)s.
1739
 
    Please examine %(limbo_dir)s to see if it contains any files you wish to
1740
 
    keep, and delete it when you are done."""
1741
 
 
1742
 
    def __init__(self, limbo_dir):
1743
 
        BzrError.__init__(self)
1744
 
        self.limbo_dir = limbo_dir
1745
 
 
1746
 
 
1747
1677
class ImmortalPendingDeletion(BzrError):
1748
1678
 
1749
1679
    _fmt = ("Unable to delete transform temporary directory "
1970
1900
        self.other = other
1971
1901
 
1972
1902
 
1973
 
class BadInventoryFormat(BzrError):
1974
 
 
1975
 
    _fmt = "Root class for inventory serialization errors"
1976
 
 
1977
 
 
1978
 
class UnexpectedInventoryFormat(BadInventoryFormat):
1979
 
 
1980
 
    _fmt = "The inventory was not in the expected format:\n %(msg)s"
1981
 
 
1982
 
    def __init__(self, msg):
1983
 
        BadInventoryFormat.__init__(self, msg=msg)
1984
 
 
1985
 
 
1986
1903
class RootNotRich(BzrError):
1987
1904
 
1988
1905
    _fmt = """This operation requires rich root data storage"""
2045
1962
        " branch location."
2046
1963
 
2047
1964
 
2048
 
class IllegalMergeDirectivePayload(BzrError):
2049
 
    """A merge directive contained something other than a patch or bundle"""
2050
 
 
2051
 
    _fmt = "Bad merge directive payload %(start)r"
2052
 
 
2053
 
    def __init__(self, start):
2054
 
        BzrError(self)
2055
 
        self.start = start
2056
 
 
2057
 
 
2058
1965
class PatchVerificationFailed(BzrError):
2059
1966
    """A patch from a merge directive could not be verified"""
2060
1967
 
2084
1991
        self.location = location
2085
1992
 
2086
1993
 
2087
 
class UnsupportedInventoryKind(BzrError):
2088
 
 
2089
 
    _fmt = """Unsupported entry kind %(kind)s"""
2090
 
 
2091
 
    def __init__(self, kind):
2092
 
        self.kind = kind
2093
 
 
2094
 
 
2095
1994
class BadSubsumeSource(BzrError):
2096
1995
 
2097
1996
    _fmt = "Can't subsume %(other_tree)s into %(tree)s. %(reason)s"