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
303
class ObjectNotLocked(LockError):
327
304
"""%(obj)r is not locked"""
328
305
# this can indicate that any particular object is not locked; see also
411
388
class DivergedBranches(BzrError):
413
389
def __init__(self, branch1, branch2):
414
390
BzrError.__init__(self, "These branches have diverged. Try merge.")
415
391
self.branch1 = branch1
457
433
class AmbiguousBase(BzrError):
458
434
def __init__(self, bases):
459
warn("BzrError AmbiguousBase has been deprecated as of bzrlib 0.8.",
461
435
msg = "The correct base is unclear, becase %s are all equally close" %\
463
437
BzrError.__init__(self, msg)
517
491
class WeaveError(BzrNewError):
518
492
"""Error in processing weave: %(message)s"""
520
493
def __init__(self, message=None):
521
494
BzrNewError.__init__(self)
522
495
self.message = message
525
498
class WeaveRevisionAlreadyPresent(WeaveError):
526
499
"""Revision {%(revision_id)s} already present in %(weave)s"""
527
500
def __init__(self, revision_id, weave):
529
501
WeaveError.__init__(self)
530
502
self.revision_id = revision_id
531
503
self.weave = weave
534
506
class WeaveRevisionNotPresent(WeaveError):
535
507
"""Revision {%(revision_id)s} not present in %(weave)s"""
537
508
def __init__(self, revision_id, weave):
538
509
WeaveError.__init__(self)
539
510
self.revision_id = revision_id
543
514
class WeaveFormatError(WeaveError):
544
515
"""Weave invariant violated: %(what)s"""
546
516
def __init__(self, what):
547
517
WeaveError.__init__(self)
576
546
self.weave_b = weave_b
579
class VersionedFileError(BzrNewError):
580
"""Versioned file error."""
583
class RevisionNotPresent(VersionedFileError):
584
"""Revision {%(revision_id)s} not present in %(file_id)s."""
586
def __init__(self, revision_id, file_id):
587
VersionedFileError.__init__(self)
588
self.revision_id = revision_id
589
self.file_id = file_id
592
class RevisionAlreadyPresent(VersionedFileError):
593
"""Revision {%(revision_id)s} already present in %(file_id)s."""
595
def __init__(self, revision_id, file_id):
596
VersionedFileError.__init__(self)
597
self.revision_id = revision_id
598
self.file_id = file_id
601
class KnitError(BzrNewError):
605
class KnitHeaderError(KnitError):
606
"""Knit header error: %(badline)r unexpected"""
608
def __init__(self, badline):
609
KnitError.__init__(self)
610
self.badline = badline
613
class KnitCorrupt(KnitError):
614
"""Knit %(filename)s corrupt: %(how)s"""
616
def __init__(self, filename, how):
617
KnitError.__init__(self)
618
self.filename = filename
622
549
class NoSuchExportFormat(BzrNewError):
623
550
"""Export format %(format)r not supported"""
624
551
def __init__(self, format):
767
694
class DependencyNotPresent(BzrNewError):
768
"""Unable to import library "%(library)s": %(error)s"""
695
"""Unable to import library: %(library)s, %(error)s"""
770
697
def __init__(self, library, error):
771
698
BzrNewError.__init__(self, library=library, error=error)
821
class MergeModifiedFormatError(BzrNewError):
822
"""Error in merge modified format"""
825
class ConflictFormatError(BzrNewError):
826
"""Format error in conflict listings"""
829
748
class CorruptRepository(BzrNewError):
830
749
"""An error has been detected in the repository %(repo_path)s.
831
750
Please run bzr reconcile on this repository."""
846
765
class LocalRequiresBoundBranch(BzrNewError):
847
766
"""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__