219
class NoRepositoryPresent(BzrNewError):
220
"""Not repository present: %(path)r"""
221
def __init__(self, bzrdir):
222
BzrNewError.__init__(self)
223
self.path = bzrdir.transport.clone('..').base
206
226
class FileInWrongBranch(BzrNewError):
207
227
"""File %(path)s in not in branch %(branch_base)s."""
208
229
def __init__(self, branch, path):
209
230
BzrNewError.__init__(self)
210
231
self.branch = branch
224
245
return 'unknown branch format: %s' % self.args[0]
248
class IncompatibleFormat(BzrNewError):
249
"""Format %(format)s is not compatible with .bzr version %(bzrdir)s."""
251
def __init__(self, format, bzrdir_format):
252
BzrNewError.__init__(self)
254
self.bzrdir = bzrdir_format
227
257
class NotVersionedError(BzrNewError):
228
258
"""%(path)s is not versioned"""
229
259
def __init__(self, path):
241
271
"""Cannot operate on a file because it is a control file."""
244
class LockError(Exception):
274
class LockError(BzrNewError):
275
"""Lock error: %(message)s"""
246
276
# All exceptions from the lock/unlock functions should be from
247
277
# this exception class. They will be translated as necessary. The
248
278
# original exception is available as e.original_error
280
# New code should prefer to raise specific subclasses
281
def __init__(self, message):
282
self.message = message
251
285
class CommitNotPossible(LockError):
252
286
"""A commit was attempted but we do not have a write lock open."""
255
291
class AlreadyCommitted(LockError):
256
292
"""A rollback was requested, but is not able to be accomplished."""
259
297
class ReadOnlyError(LockError):
260
"""A write attempt was made in a read only transaction."""
298
"""A write attempt was made in a read only transaction on %(obj)s"""
299
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
310
class ReadOnlyObjectDirtiedError(ReadOnlyError):
311
"""Cannot change object %(obj)r in read only transaction"""
312
def __init__(self, obj):
316
class UnlockableTransport(LockError):
317
"""Cannot lock: transport is read only: %(transport)s"""
318
def __init__(self, transport):
319
self.transport = transport
322
class LockContention(LockError):
323
"""Could not acquire lock %(lock)s"""
324
# TODO: show full url for lock, combining the transport and relative bits?
325
def __init__(self, lock):
329
class LockBroken(LockError):
330
"""Lock was broken while still open: %(lock)s - check storage consistency!"""
331
def __init__(self, lock):
335
class LockBreakMismatch(LockError):
336
"""Lock was released and re-acquired before being broken: %(lock)s: held by %(holder)r, wanted to break %(target)r"""
337
def __init__(self, lock, holder, target):
343
class LockNotHeld(LockError):
344
"""Lock not held: %(lock)s"""
345
def __init__(self, lock):
349
class BranchNotLocked(LockError):
350
"""Branch %(branch)r not locked"""
351
def __init__(self, branch):
263
355
class PointlessCommit(BzrNewError):
268
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)
271
371
class StrictCommitFailed(Exception):
272
372
"""Commit refused because there are unknowns in the tree."""
275
374
class NoSuchRevision(BzrError):
276
375
def __init__(self, branch, revision):
277
376
self.branch = branch
404
503
self.weave_b = weave_b
506
class WeaveTextDiffers(WeaveError):
507
"""Weaves differ on text content. Revision: {%(revision_id)s}, %(weave_a)s, %(weave_b)s"""
509
def __init__(self, revision_id, weave_a, weave_b):
510
WeaveError.__init__(self)
511
self.revision_id = revision_id
512
self.weave_a = weave_a
513
self.weave_b = weave_b
407
516
class NoSuchExportFormat(BzrNewError):
408
517
"""Export format %(format)r not supported"""
409
518
def __init__(self, format):
509
618
self.text_revision = text_revision
510
619
self.file_id = file_id
621
class DuplicateKey(BzrNewError):
622
"""Key %(key)s is already present in map"""
624
class MalformedTransform(BzrNewError):
625
"""Tree transform is malformed %(conflicts)r"""
513
628
class BzrBadParameter(BzrNewError):
514
629
"""A bad parameter : %(param)s is not usable.
525
640
"""Parameter %(param)s is neither unicode nor utf8."""
643
class ReusingTransform(BzrNewError):
644
"""Attempt to reuse a transform that has already been applied."""
647
class CantMoveRoot(BzrNewError):
648
"""Moving the root directory is not supported at this time"""
528
651
class BzrBadParameterNotString(BzrBadParameter):
529
652
"""Parameter %(param)s is not a string or unicode string."""
655
class BzrBadParameterMissing(BzrBadParameter):
656
"""Parameter $(param)s is required but not present."""
532
659
class DependencyNotPresent(BzrNewError):
533
660
"""Unable to import library: %(library)s, %(error)s"""
549
676
def __init__(self, format):
550
677
BzrNewError.__init__(self)
551
678
self.format = format
681
class NoDiff3(BzrNewError):
682
"""Diff3 is not installed on this machine."""
685
class ExistingLimbo(BzrNewError):
686
"""This tree contains left-over files from a failed operation.
687
Please examine %(limbo_dir)s to see if it contains any files you wish to
688
keep, and delete it when you are done.
690
def __init__(self, limbo_dir):
691
BzrNewError.__init__(self)
692
self.limbo_dir = limbo_dir
695
class ImmortalLimbo(BzrNewError):
696
"""Unable to delete transform temporary directory $(limbo_dir)s.
697
Please examine %(limbo_dir)s to see if it contains any files you wish to
698
keep, and delete it when you are done.
700
def __init__(self, limbo_dir):
701
BzrNewError.__init__(self)
702
self.limbo_dir = limbo_dir
705
class OutOfDateTree(BzrNewError):
706
"""Working tree is out of date, please run 'bzr update'."""
708
def __init__(self, tree):
709
BzrNewError.__init__(self)