~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-03 20:18:35 UTC
  • mfrom: (1185.82.137 w-changeset)
  • Revision ID: pqm@pqm.ubuntu.com-20060603201835-1c9a1725641ccd24
Implement bundles

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
 
56
56
from warnings import warn
57
57
 
 
58
from bzrlib.patches import (PatchSyntax, 
 
59
                            PatchConflict, 
 
60
                            MalformedPatchHeader,
 
61
                            MalformedHunkHeader,
 
62
                            MalformedLine,)
 
63
 
 
64
 
58
65
# based on Scott James Remnant's hct error classes
59
66
 
60
67
# TODO: is there any value in providing the .args field used by standard
740
747
    """
741
748
 
742
749
 
 
750
class NoBundleFound(BzrNewError):
 
751
    """No bundle was found in %(filename)s"""
 
752
    def __init__(self, filename):
 
753
        BzrNewError.__init__(self)
 
754
        self.filename = filename
 
755
 
 
756
 
 
757
class BundleNotSupported(BzrNewError):
 
758
    """Unable to handle bundle version %(version)s: %(msg)s"""
 
759
    def __init__(self, version, msg):
 
760
        BzrNewError.__init__(self)
 
761
        self.version = version
 
762
        self.msg = msg
 
763
 
 
764
 
743
765
class MissingText(BzrNewError):
744
766
    """Branch %(base)s is missing revision %(text_revision)s of %(file_id)s"""
745
767
 
903
925
    def __init__(self, path):
904
926
        BzrNewError.__init__(self)
905
927
        self.path = path
 
928
 
 
929
 
 
930
class TestamentMismatch(BzrNewError):
 
931
    """Testament did not match expected value.  
 
932
       For revision_id {%(revision_id)s}, expected {%(expected)s}, measured 
 
933
       {%(measured)s}
 
934
    """
 
935
    def __init__(self, revision_id, expected, measured):
 
936
        self.revision_id = revision_id
 
937
        self.expected = expected
 
938
        self.measured = measured
 
939
 
 
940
 
 
941
class BadBundle(Exception): pass
 
942
 
 
943
 
 
944
class MalformedHeader(BadBundle): pass
 
945
 
 
946
 
 
947
class MalformedPatches(BadBundle): pass
 
948
 
 
949
 
 
950
class MalformedFooter(BadBundle): pass