175
173
class PathError(BzrNewError):
176
174
"""Generic path error: %(path)r%(extra)s)"""
178
175
def __init__(self, path, extra=None):
179
176
BzrNewError.__init__(self)
196
193
"""Directory not empty: %(path)r%(extra)s"""
199
class ResourceBusy(PathError):
200
"""Device or resource busy: %(path)r%(extra)s"""
203
196
class PermissionDenied(PathError):
204
197
"""Permission denied: %(path)r%(extra)s"""
219
class NotBranchError(PathError):
212
class NotBranchError(BzrNewError):
220
213
"""Not a branch: %(path)s"""
223
class AlreadyBranchError(PathError):
224
"""Already a branch: %(path)s. Use `bzr checkout` to build a working tree."""
214
def __init__(self, path):
215
BzrNewError.__init__(self)
227
219
class NoRepositoryPresent(BzrNewError):
272
class PathsNotVersionedError(BzrNewError):
273
# used when reporting several paths are not versioned
274
"""Path(s) are not versioned: %(paths_as_string)s"""
276
def __init__(self, paths):
277
from bzrlib.osutils import quotefn
278
BzrNewError.__init__(self)
280
self.paths_as_string = ' '.join([quotefn(p) for p in paths])
283
264
class BadFileKindError(BzrError):
284
265
"""Specified file is of a kind that cannot be added.
322
class OutSideTransaction(BzrNewError):
323
"""A transaction related operation was attempted after the transaction finished."""
326
class ObjectNotLocked(LockError):
327
"""%(obj)r is not locked"""
328
# this can indicate that any particular object is not locked; see also
329
# LockNotHeld which means that a particular *lock* object is not held by
330
# the caller -- perhaps they should be unified.
331
def __init__(self, obj):
303
class BranchNotLocked(LockError):
304
"""Branch %(branch)r is not locked"""
305
def __init__(self, branch):
306
# XXX: sometimes called with a LockableFiles instance not a Branch
335
310
class ReadOnlyObjectDirtiedError(ReadOnlyError):
349
class BranchNotLocked(LockError):
350
"""Branch %(branch)r not locked"""
351
def __init__(self, branch):
374
355
class PointlessCommit(BzrNewError):
375
356
"""No changes to commit"""
387
368
self.format = format
391
371
class StrictCommitFailed(Exception):
392
372
"""Commit refused because there are unknowns in the tree."""
395
374
class NoSuchRevision(BzrError):
396
375
def __init__(self, branch, revision):
397
376
self.branch = branch
411
390
class DivergedBranches(BzrError):
413
391
def __init__(self, branch1, branch2):
414
392
BzrError.__init__(self, "These branches have diverged. Try merge.")
415
393
self.branch1 = branch1
437
415
BzrError.__init__(self, msg)
441
418
class NotAncestor(BzrError):
442
419
def __init__(self, rev_id, not_ancestor_id):
443
420
msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id,
457
434
class AmbiguousBase(BzrError):
458
435
def __init__(self, bases):
459
warn("BzrError AmbiguousBase has been deprecated as of bzrlib 0.8.",
461
436
msg = "The correct base is unclear, becase %s are all equally close" %\
463
438
BzrError.__init__(self, msg)
475
450
BzrError.__init__(self, "Store %s is not listable" % store)
479
453
class UnlistableBranch(BzrError):
480
454
def __init__(self, br):
481
455
BzrError.__init__(self, "Stores for branch %s are not listable" % br)
484
class BoundBranchOutOfDate(BzrNewError):
485
"""Bound branch %(branch)s is out of date with master branch %(master)s."""
486
def __init__(self, branch, master):
487
BzrNewError.__init__(self)
492
class CommitToDoubleBoundBranch(BzrNewError):
493
"""Cannot commit to branch %(branch)s. It is bound to %(master)s, which is bound to %(remote)s."""
494
def __init__(self, branch, master, remote):
495
BzrNewError.__init__(self)
501
class OverwriteBoundBranch(BzrNewError):
502
"""Cannot pull --overwrite to a branch which is bound %(branch)s"""
503
def __init__(self, branch):
504
BzrNewError.__init__(self)
508
class BoundBranchConnectionFailure(BzrNewError):
509
"""Unable to connect to target of bound branch %(branch)s => %(target)s: %(error)s"""
510
def __init__(self, branch, target, error):
511
BzrNewError.__init__(self)
517
458
class WeaveError(BzrNewError):
518
459
"""Error in processing weave: %(message)s"""
724
665
self.text_revision = text_revision
725
666
self.file_id = file_id
728
668
class DuplicateKey(BzrNewError):
729
669
"""Key %(key)s is already present in map"""
732
671
class MalformedTransform(BzrNewError):
733
672
"""Tree transform is malformed %(conflicts)r"""
767
706
class DependencyNotPresent(BzrNewError):
768
"""Unable to import library "%(library)s": %(error)s"""
707
"""Unable to import library: %(library)s, %(error)s"""
770
709
def __init__(self, library, error):
771
710
BzrNewError.__init__(self, library=library, error=error)
816
755
def __init__(self, tree):
817
756
BzrNewError.__init__(self)
821
class MergeModifiedFormatError(BzrNewError):
822
"""Error in merge modified format"""
825
class ConflictFormatError(BzrNewError):
826
"""Format error in conflict listings"""
829
class CorruptRepository(BzrNewError):
830
"""An error has been detected in the repository %(repo_path)s.
831
Please run bzr reconcile on this repository."""
833
def __init__(self, repo):
834
BzrNewError.__init__(self)
835
self.repo_path = repo.bzrdir.root_transport.base
838
class UpgradeRequired(BzrNewError):
839
"""To use this feature you must upgrade your branch at %(path)s."""
841
def __init__(self, path):
842
BzrNewError.__init__(self)
846
class LocalRequiresBoundBranch(BzrNewError):
847
"""Cannot perform local-only commits on unbound branches."""
850
class MissingProgressBarFinish(BzrNewError):
851
"""A nested progress bar was not 'finished' correctly."""
854
class UnsupportedOperation(BzrNewError):
855
"""The method %(mname)s is not supported on objects of type %(tname)s."""
856
def __init__(self, method, method_self):
858
self.mname = method.__name__
859
self.tname = type(method_self).__name__