223
class NoRepositoryPresent(BzrNewError):
224
"""Not repository present: %(path)r"""
225
def __init__(self, bzrdir):
226
BzrNewError.__init__(self)
227
self.path = bzrdir.transport.clone('..').base
210
230
class FileInWrongBranch(BzrNewError):
211
231
"""File %(path)s in not in branch %(branch_base)s."""
212
233
def __init__(self, branch, path):
213
234
BzrNewError.__init__(self)
214
235
self.branch = branch
228
249
return 'unknown branch format: %s' % self.args[0]
252
class IncompatibleFormat(BzrNewError):
253
"""Format %(format)s is not compatible with .bzr version %(bzrdir)s."""
255
def __init__(self, format, bzrdir_format):
256
BzrNewError.__init__(self)
258
self.bzrdir = bzrdir_format
231
261
class NotVersionedError(BzrNewError):
232
262
"""%(path)s is not versioned"""
233
263
def __init__(self, path):
245
275
"""Cannot operate on a file because it is a control file."""
248
class LockError(Exception):
278
class LockError(BzrNewError):
279
"""Lock error: %(message)s"""
250
280
# All exceptions from the lock/unlock functions should be from
251
281
# this exception class. They will be translated as necessary. The
252
282
# original exception is available as e.original_error
284
# New code should prefer to raise specific subclasses
285
def __init__(self, message):
286
self.message = message
255
289
class CommitNotPossible(LockError):
256
290
"""A commit was attempted but we do not have a write lock open."""
259
295
class AlreadyCommitted(LockError):
260
296
"""A rollback was requested, but is not able to be accomplished."""
263
301
class ReadOnlyError(LockError):
264
"""A write attempt was made in a read only transaction."""
302
"""A write attempt was made in a read only transaction on %(obj)s"""
303
def __init__(self, obj):
307
class ObjectNotLocked(LockError):
308
"""%(obj)r is not locked"""
309
# this can indicate that any particular object is not locked; see also
310
# LockNotHeld which means that a particular *lock* object is not held by
311
# the caller -- perhaps they should be unified.
312
def __init__(self, obj):
316
class ReadOnlyObjectDirtiedError(ReadOnlyError):
317
"""Cannot change object %(obj)r in read only transaction"""
318
def __init__(self, obj):
322
class UnlockableTransport(LockError):
323
"""Cannot lock: transport is read only: %(transport)s"""
324
def __init__(self, transport):
325
self.transport = transport
328
class LockContention(LockError):
329
"""Could not acquire lock %(lock)s"""
330
# TODO: show full url for lock, combining the transport and relative bits?
331
def __init__(self, lock):
335
class LockBroken(LockError):
336
"""Lock was broken while still open: %(lock)s - check storage consistency!"""
337
def __init__(self, lock):
341
class LockBreakMismatch(LockError):
342
"""Lock was released and re-acquired before being broken: %(lock)s: held by %(holder)r, wanted to break %(target)r"""
343
def __init__(self, lock, holder, target):
349
class LockNotHeld(LockError):
350
"""Lock not held: %(lock)s"""
351
def __init__(self, lock):
267
355
class PointlessCommit(BzrNewError):
272
360
"""Upgrade URL cannot work with readonly URL's."""
363
class UpToDateFormat(BzrNewError):
364
"""The branch format %(format)s is already at the most recent format."""
366
def __init__(self, format):
367
BzrNewError.__init__(self)
275
372
class StrictCommitFailed(Exception):
276
373
"""Commit refused because there are unknowns in the tree."""
355
453
BzrError.__init__(self, "Store %s is not listable" % store)
358
457
class UnlistableBranch(BzrError):
359
458
def __init__(self, br):
360
459
BzrError.__init__(self, "Stores for branch %s are not listable" % br)
462
class BoundBranchOutOfDate(BzrNewError):
463
"""Bound branch %(branch)s is out of date with master branch %(master)s."""
464
def __init__(self, branch, master):
465
BzrNewError.__init__(self)
470
class CommitToDoubleBoundBranch(BzrNewError):
471
"""Cannot commit to branch %(branch)s. It is bound to %(master)s, which is bound to %(remote)s."""
472
def __init__(self, branch, master, remote):
473
BzrNewError.__init__(self)
479
class OverwriteBoundBranch(BzrNewError):
480
"""Cannot pull --overwrite to a branch which is bound %(branch)s"""
481
def __init__(self, branch):
482
BzrNewError.__init__(self)
486
class BoundBranchConnectionFailure(BzrNewError):
487
"""Unable to connect to target of bound branch %(branch)s => %(target)s: %(error)s"""
488
def __init__(self, branch, target, error):
489
BzrNewError.__init__(self)
363
495
class WeaveError(BzrNewError):
364
496
"""Error in processing weave: %(message)s"""
365
498
def __init__(self, message=None):
366
499
BzrNewError.__init__(self)
367
500
self.message = message
408
544
self.weave_b = weave_b
547
class WeaveTextDiffers(WeaveError):
548
"""Weaves differ on text content. Revision: {%(revision_id)s}, %(weave_a)s, %(weave_b)s"""
550
def __init__(self, revision_id, weave_a, weave_b):
551
WeaveError.__init__(self)
552
self.revision_id = revision_id
553
self.weave_a = weave_a
554
self.weave_b = weave_b
557
class VersionedFileError(BzrNewError):
558
"""Versioned file error."""
561
class RevisionNotPresent(VersionedFileError):
562
"""Revision {%(revision_id)s} not present in %(file_id)s."""
564
def __init__(self, revision_id, file_id):
565
VersionedFileError.__init__(self)
566
self.revision_id = revision_id
567
self.file_id = file_id
570
class RevisionAlreadyPresent(VersionedFileError):
571
"""Revision {%(revision_id)s} already present in %(file_id)s."""
573
def __init__(self, revision_id, file_id):
574
VersionedFileError.__init__(self)
575
self.revision_id = revision_id
576
self.file_id = file_id
579
class KnitError(BzrNewError):
583
class KnitHeaderError(KnitError):
584
"""Knit header error: %(badline)r unexpected"""
586
def __init__(self, badline):
587
KnitError.__init__(self)
588
self.badline = badline
591
class KnitCorrupt(KnitError):
592
"""Knit %(filename)s corrupt: %(how)s"""
594
def __init__(self, filename, how):
595
KnitError.__init__(self)
596
self.filename = filename
411
600
class NoSuchExportFormat(BzrNewError):
412
601
"""Export format %(format)r not supported"""
413
602
def __init__(self, format):
514
703
self.file_id = file_id
706
class DuplicateKey(BzrNewError):
707
"""Key %(key)s is already present in map"""
710
class MalformedTransform(BzrNewError):
711
"""Tree transform is malformed %(conflicts)r"""
517
714
class BzrBadParameter(BzrNewError):
518
715
"""A bad parameter : %(param)s is not usable.
529
726
"""Parameter %(param)s is neither unicode nor utf8."""
729
class ReusingTransform(BzrNewError):
730
"""Attempt to reuse a transform that has already been applied."""
733
class CantMoveRoot(BzrNewError):
734
"""Moving the root directory is not supported at this time"""
532
737
class BzrBadParameterNotString(BzrBadParameter):
533
738
"""Parameter %(param)s is not a string or unicode string."""
741
class BzrBadParameterMissing(BzrBadParameter):
742
"""Parameter $(param)s is required but not present."""
536
745
class DependencyNotPresent(BzrNewError):
537
746
"""Unable to import library: %(library)s, %(error)s"""
553
762
def __init__(self, format):
554
763
BzrNewError.__init__(self)
555
764
self.format = format
767
class NoDiff3(BzrNewError):
768
"""Diff3 is not installed on this machine."""
771
class ExistingLimbo(BzrNewError):
772
"""This tree contains left-over files from a failed operation.
773
Please examine %(limbo_dir)s to see if it contains any files you wish to
774
keep, and delete it when you are done.
776
def __init__(self, limbo_dir):
777
BzrNewError.__init__(self)
778
self.limbo_dir = limbo_dir
781
class ImmortalLimbo(BzrNewError):
782
"""Unable to delete transform temporary directory $(limbo_dir)s.
783
Please examine %(limbo_dir)s to see if it contains any files you wish to
784
keep, and delete it when you are done.
786
def __init__(self, limbo_dir):
787
BzrNewError.__init__(self)
788
self.limbo_dir = limbo_dir
791
class OutOfDateTree(BzrNewError):
792
"""Working tree is out of date, please run 'bzr update'."""
794
def __init__(self, tree):
795
BzrNewError.__init__(self)
799
class MergeModifiedFormatError(BzrNewError):
800
"""Error in merge modified format"""
803
class CorruptRepository(BzrNewError):
804
"""An error has been detected in the repository %(repo_path)s.
805
Please run bzr reconcile on this repository."""
807
def __init__(self, repo):
808
BzrNewError.__init__(self)
809
self.repo_path = repo.bzrdir.root_transport.base
812
class UpgradeRequired(BzrNewError):
813
"""To use this feature you must upgrade your branch at %(path)s."""
815
def __init__(self, path):
816
BzrNewError.__init__(self)
820
class LocalRequiresBoundBranch(BzrNewError):
821
"""Cannot perform local-only commits on unbound branches."""
824
class MissingProgressBarFinish(BzrNewError):
825
"""A nested progress bar was not 'finished' correctly."""