/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-04-12 06:22:44 UTC
  • mfrom: (1558.12.10 fix-mergesums)
  • Revision ID: pqm@pqm.ubuntu.com-20060412062244-b1ea5860b8463060
Minor bugfixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
fullstop.
54
54
"""
55
55
 
56
 
from warnings import warn
57
 
 
58
56
# based on Scott James Remnant's hct error classes
59
57
 
60
58
# TODO: is there any value in providing the .args field used by standard
174
172
 
175
173
class PathError(BzrNewError):
176
174
    """Generic path error: %(path)r%(extra)s)"""
177
 
 
178
175
    def __init__(self, path, extra=None):
179
176
        BzrNewError.__init__(self)
180
177
        self.path = path
216
213
            self.extra = ''
217
214
 
218
215
 
219
 
class NotBranchError(PathError):
 
216
class NotBranchError(BzrNewError):
220
217
    """Not a branch: %(path)s"""
221
 
 
222
 
 
223
 
class AlreadyBranchError(PathError):
224
 
    """Already a branch: %(path)s. Use `bzr checkout` to build a working tree."""
 
218
    def __init__(self, path):
 
219
        BzrNewError.__init__(self)
 
220
        self.path = path
225
221
 
226
222
 
227
223
class NoRepositoryPresent(BzrNewError):
269
265
        self.path = path
270
266
 
271
267
 
272
 
class PathsNotVersionedError(BzrNewError):
273
 
    # used when reporting several paths are not versioned
274
 
    """Path(s) are not versioned: %(paths_as_string)s"""
275
 
 
276
 
    def __init__(self, paths):
277
 
        from bzrlib.osutils import quotefn
278
 
        BzrNewError.__init__(self)
279
 
        self.paths = paths
280
 
        self.paths_as_string = ' '.join([quotefn(p) for p in paths])
281
 
 
282
 
 
283
268
class BadFileKindError(BzrError):
284
269
    """Specified file is of a kind that cannot be added.
285
270
 
456
441
 
457
442
class AmbiguousBase(BzrError):
458
443
    def __init__(self, bases):
459
 
        warn("BzrError AmbiguousBase has been deprecated as of bzrlib 0.8.",
460
 
                DeprecationWarning)
461
444
        msg = "The correct base is unclear, becase %s are all equally close" %\
462
445
            ", ".join(bases)
463
446
        BzrError.__init__(self, msg)