~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Robert Collins
  • Date: 2005-10-27 19:45:18 UTC
  • mfrom: (1185.16.130)
  • Revision ID: robertc@robertcollins.net-20051027194518-58afabc9ab280bb0
MergeĀ fromĀ Martin

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: UTF-8 -*-
 
1
# (C) 2005 Canonical
2
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
101
101
class BzrCheckError(BzrNewError):
102
102
    """Internal check failed: %(message)s"""
103
103
    def __init__(self, message):
 
104
        BzrNewError.__init__(self)
104
105
        self.message = message
105
106
 
106
107
 
107
108
class InvalidEntryName(BzrNewError):
108
109
    """Invalid entry name: %(name)s"""
109
110
    def __init__(self, name):
 
111
        BzrNewError.__init__(self)
110
112
        self.name = name
111
113
 
112
114
 
113
115
class InvalidRevisionNumber(BzrNewError):
114
116
    """Invalid revision number %(revno)d"""
115
117
    def __init__(self, revno):
 
118
        BzrNewError.__init__(self)
116
119
        self.revno = revno
117
120
 
118
121
 
119
122
class InvalidRevisionId(BzrNewError):
120
 
    """Invalid revision-id"""
 
123
    """Invalid revision-id {%(revision_id)s} in %(branch)s"""
 
124
    def __init__(self, revision_id, branch):
 
125
        BzrNewError.__init__(self)
 
126
        self.revision_id = revision_id
 
127
        self.branch = branch
121
128
 
122
129
 
123
130
class BzrCommandError(BzrError):
180
187
class PointlessCommit(BzrNewError):
181
188
    """No changes to commit"""
182
189
 
 
190
class StrictCommitFailed(Exception):
 
191
    """Commit refused because there are unknowns in the tree."""
183
192
 
184
193
class NoSuchRevision(BzrError):
185
194
    def __init__(self, branch, revision):
268
277
        BzrError.__init__(self, "Stores for branch %s are not listable" % br)
269
278
 
270
279
 
271
 
from bzrlib.weave import WeaveError, WeaveParentMismatch
 
280
class WeaveError(BzrNewError):
 
281
    """Error in processing weave: %(message)s"""
 
282
    def __init__(self, message=None):
 
283
        BzrNewError.__init__(self)
 
284
        self.message = message
 
285
 
 
286
 
 
287
class WeaveRevisionAlreadyPresent(WeaveError):
 
288
    """Revision {%(revision_id)s} already present in %(weave)s"""
 
289
    def __init__(self, revision_id, weave):
 
290
        WeaveError.__init__(self)
 
291
        self.revision_id = revision_id
 
292
        self.weave = weave
 
293
 
 
294
 
 
295
class WeaveRevisionNotPresent(WeaveError):
 
296
    """Revision {%(revision_id)s} not present in %(weave)s"""
 
297
    def __init__(self, revision_id, weave):
 
298
        WeaveError.__init__(self)
 
299
        self.revision_id = revision_id
 
300
        self.weave = weave
 
301
 
 
302
 
 
303
class WeaveFormatError(WeaveError):
 
304
    """Weave invariant violated: %(what)s"""
 
305
    def __init__(self, what):
 
306
        WeaveError.__init__(self)
 
307
        self.what = what
 
308
 
 
309
 
 
310
class WeaveParentMismatch(WeaveError):
 
311
    """Parents are mismatched between two revisions."""
 
312
    
272
313
 
273
314
class TransportError(BzrError):
274
315
    """All errors thrown by Transport implementations should derive
343
384
    def __init__(self, command_line):
344
385
        BzrError.__init__(self, "Failed to gpg sign data with command '%s'"
345
386
                               % command_line)
 
387
 
 
388
class WorkingTreeNotRevision(BzrError):
 
389
    def __init__(self, tree):
 
390
        BzrError.__init__(self, "The working tree for %s has changed since"
 
391
                          " last commit, but weave merge requires that it be"
 
392
                          " unchanged." % tree.basedir)
 
393
 
 
394
class GraphCycleError(BzrNewError):
 
395
    """Cycle in graph %(graph)r"""
 
396
    def __init__(self, graph):
 
397
        BzrNewError.__init__(self)
 
398
        self.graph = graph