~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Martin Pool
  • Date: 2005-09-22 13:32:02 UTC
  • Revision ID: mbp@sourcefrog.net-20050922133202-347cfd35d2941dd5
- simple weave-based annotate code (not complete)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
1
2
# -*- coding: UTF-8 -*-
2
3
 
3
4
# This program is free software; you can redistribute it and/or modify
104
105
                          % (branch, object_type, object_id))
105
106
 
106
107
 
107
 
class DivergedBranches(BzrError):
108
 
    def __init__(self, branch1, branch2):
109
 
        BzrError.__init__(self, "These branches have diverged.")
110
 
        self.branch1 = branch1
111
 
        self.branch2 = branch2
112
 
 
113
 
 
114
108
class UnrelatedBranches(BzrCommandError):
115
109
    def __init__(self):
116
110
        msg = "Branches have no common ancestor, and no base revision"\
117
111
            " specified."
118
112
        BzrCommandError.__init__(self, msg)
119
113
 
120
 
class NoCommonAncestor(BzrError):
121
 
    def __init__(self, revision_a, revision_b):
122
 
        msg = "Revisions have no common ancestor: %s %s." \
123
 
            % (revision_a, revision_b) 
124
 
        BzrError.__init__(self, msg)
125
 
 
126
 
class NoCommonRoot(BzrError):
127
 
    def __init__(self, revision_a, revision_b):
128
 
        msg = "Revisions are not derived from the same root: %s %s." \
129
 
            % (revision_a, revision_b) 
130
 
        BzrError.__init__(self, msg)
131
114
 
132
115
class NotAncestor(BzrError):
133
116
    def __init__(self, rev_id, not_ancestor_id):
 
117
        self.rev_id = rev_id
 
118
        self.not_ancestor_id = not_ancestor_id
134
119
        msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id, 
135
120
                                                        rev_id)
136
121
        BzrError.__init__(self, msg)
137
 
        self.rev_id = rev_id
138
 
        self.not_ancestor_id = not_ancestor_id
139
122
 
140
123
 
141
124
class InstallFailed(BzrError):
142
125
    def __init__(self, revisions):
 
126
        self.revisions = revisions
143
127
        msg = "Could not install revisions:\n%s" % " ,".join(revisions)
144
128
        BzrError.__init__(self, msg)
145
 
        self.revisions = revisions
146
129
 
147
130
 
148
131
class AmbiguousBase(BzrError):
152
135
        BzrError.__init__(self, msg)
153
136
        self.bases = bases
154
137
 
155
 
class NoCommits(BzrError):
156
 
    def __init__(self, branch):
157
 
        msg = "Branch %s has no commits." % branch
158
 
        BzrError.__init__(self, msg)
159
 
 
160
 
class UnlistableStore(BzrError):
161
 
    def __init__(self, store):
162
 
        BzrError.__init__(self, "Store %s is not listable" % store)
163
 
 
164
 
class UnlistableBranch(BzrError):
165
 
    def __init__(self, br):
166
 
        BzrError.__init__(self, "Stores for branch %s are not listable" % br)
167
 
 
168
 
 
169
 
from bzrlib.weave import WeaveError