~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Lalo Martins
  • Date: 2005-09-15 15:16:12 UTC
  • mfrom: (1185.1.18)
  • mto: (1185.1.22)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: lalo@exoweb.net-20050915151611-86c5de4298bb71f9
merging from integration again.

This is a "checkpoint" commit; the tests don't actually pass, but all the
really hard stuff has been merged (in particular, Aaron's new ancestor:
namespace was moved to revisionspec).

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
class BzrError(StandardError):
26
26
    pass
27
27
 
 
28
 
28
29
class BzrCheckError(BzrError):
29
30
    pass
30
31
 
94
95
 
95
96
class DivergedBranches(BzrError):
96
97
    def __init__(self, branch1, branch2):
 
98
        BzrError.__init__(self, "These branches have diverged.")
97
99
        self.branch1 = branch1
98
100
        self.branch2 = branch2
99
 
        BzrError.__init__(self, "These branches have diverged.")
100
101
 
101
102
class UnrelatedBranches(BzrCommandError):
102
103
    def __init__(self):
104
105
            " specified."
105
106
        BzrCommandError.__init__(self, msg)
106
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)
107
119
 
108
120
class NotAncestor(BzrError):
109
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)
110
125
        self.rev_id = rev_id
111
126
        self.not_ancestor_id = not_ancestor_id
112
 
        msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id, 
113
 
                                                        rev_id)
114
 
        BzrError.__init__(self, msg)
115
127
 
116
128
 
117
129
class InstallFailed(BzrError):
118
130
    def __init__(self, revisions):
 
131
        msg = "Could not install revisions:\n%s" % " ,".join(revisions)
 
132
        BzrError.__init__(self, msg)
119
133
        self.revisions = revisions
120
 
        msg = "Could not install revisions:\n%s" % " ,".join(revisions)
121
 
        BzrError.__init__(self, msg)
122
134
 
123
135
 
124
136
class AmbiguousBase(BzrError):
128
140
        BzrError.__init__(self, msg)
129
141
        self.bases = bases
130
142
 
 
143
class NoCommits(BzrError):
 
144
    def __init__(self, branch):
 
145
        msg = "Branch %s has no commits." % branch
 
146
        BzrError.__init__(self, msg)