~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-08-21 04:15:04 UTC
  • mto: (1092.1.41) (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1110.
  • Revision ID: aaron.bentley@utoronto.ca-20050821041504-866f53c120065af3
Added revision-based common-ancestor checking

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
class BzrError(StandardError):
26
26
    pass
27
27
 
28
 
 
29
28
class BzrCheckError(BzrError):
30
29
    pass
31
30
 
92
91
        msg = "Branch %s has no revision %s" % (branch, revision)
93
92
        BzrError.__init__(self, msg)
94
93
 
95
 
 
96
 
class DivergedBranches(BzrError):
97
 
    def __init__(self, branch1, branch2):
98
 
        BzrError.__init__(self, "These branches have diverged.")
99
 
        self.branch1 = branch1
100
 
        self.branch2 = branch2
101
 
 
102
 
class UnrelatedBranches(BzrCommandError):
103
 
    def __init__(self):
104
 
        msg = "Branches have no common ancestor, and no base revision"\
105
 
            " specified."
106
 
        BzrCommandError.__init__(self, msg)
107
 
 
108
 
class NoCommonAncestor(BzrError):
109
 
    def __init__(self, revision_a, revision_b):
110
 
        msg = "Revisions have no common ancestor: %s %s." \
111
 
            % (revision_a, revision_b) 
112
 
        BzrError.__init__(self, msg)
113
 
 
114
 
class NoCommonRoot(BzrError):
115
 
    def __init__(self, revision_a, revision_b):
116
 
        msg = "Revisions are not derived from the same root: %s %s." \
117
 
            % (revision_a, revision_b) 
118
 
        BzrError.__init__(self, msg)
119
 
 
120
 
class NotAncestor(BzrError):
121
 
    def __init__(self, rev_id, not_ancestor_id):
122
 
        msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id, 
123
 
                                                        rev_id)
124
 
        BzrError.__init__(self, msg)
125
 
        self.rev_id = rev_id
126
 
        self.not_ancestor_id = not_ancestor_id
127
 
 
128
 
 
129
94
class InstallFailed(BzrError):
130
95
    def __init__(self, revisions):
 
96
        self.revisions = revisions
131
97
        msg = "Could not install revisions:\n%s" % " ,".join(revisions)
132
98
        BzrError.__init__(self, msg)
133
 
        self.revisions = revisions
134
 
 
135
 
 
136
 
class AmbiguousBase(BzrError):
137
 
    def __init__(self, bases):
138
 
        msg = "The correct base is unclear, becase %s are all equally close" %\
139
 
            ", ".join(bases)
140
 
        BzrError.__init__(self, msg)
141
 
        self.bases = bases
142
 
 
143
 
class NoCommits(BzrError):
144
 
    def __init__(self, branch):
145
 
        msg = "Branch %s has no commits." % branch
146
 
        BzrError.__init__(self, msg)