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 ObjectNotLocked(LockError):
304
"""%(obj)r is not locked"""
305
# this can indicate that any particular object is not locked; see also
306
# LockNotHeld which means that a particular *lock* object is not held by
307
# the caller -- perhaps they should be unified.
308
def __init__(self, obj):
312
class ReadOnlyObjectDirtiedError(ReadOnlyError):
313
"""Cannot change object %(obj)r in read only transaction"""
314
def __init__(self, obj):
318
class UnlockableTransport(LockError):
319
"""Cannot lock: transport is read only: %(transport)s"""
320
def __init__(self, transport):
321
self.transport = transport
324
class LockContention(LockError):
325
"""Could not acquire lock %(lock)s"""
326
# TODO: show full url for lock, combining the transport and relative bits?
327
def __init__(self, lock):
331
class LockBroken(LockError):
332
"""Lock was broken while still open: %(lock)s - check storage consistency!"""
333
def __init__(self, lock):
337
class LockBreakMismatch(LockError):
338
"""Lock was released and re-acquired before being broken: %(lock)s: held by %(holder)r, wanted to break %(target)r"""
339
def __init__(self, lock, holder, target):
345
class LockNotHeld(LockError):
346
"""Lock not held: %(lock)s"""
347
def __init__(self, lock):
263
351
class PointlessCommit(BzrNewError):
268
356
"""Upgrade URL cannot work with readonly URL's."""
359
class UpToDateFormat(BzrNewError):
360
"""The branch format %(format)s is already at the most recent format."""
362
def __init__(self, format):
363
BzrNewError.__init__(self)
271
368
class StrictCommitFailed(Exception):
272
369
"""Commit refused because there are unknowns in the tree."""
302
399
BzrCommandError.__init__(self, msg)
304
402
class NoCommonAncestor(BzrError):
305
403
def __init__(self, revision_a, revision_b):
306
404
msg = "Revisions have no common ancestor: %s %s." \
307
405
% (revision_a, revision_b)
308
406
BzrError.__init__(self, msg)
310
409
class NoCommonRoot(BzrError):
311
410
def __init__(self, revision_a, revision_b):
312
411
msg = "Revisions are not derived from the same root: %s %s." \
313
412
% (revision_a, revision_b)
314
413
BzrError.__init__(self, msg)
316
417
class NotAncestor(BzrError):
317
418
def __init__(self, rev_id, not_ancestor_id):
318
419
msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id,
336
437
BzrError.__init__(self, msg)
337
438
self.bases = bases
339
441
class NoCommits(BzrError):
340
442
def __init__(self, branch):
341
443
msg = "Branch %s has no commits." % branch
342
444
BzrError.__init__(self, msg)
344
447
class UnlistableStore(BzrError):
345
448
def __init__(self, store):
346
449
BzrError.__init__(self, "Store %s is not listable" % store)
348
453
class UnlistableBranch(BzrError):
349
454
def __init__(self, br):
350
455
BzrError.__init__(self, "Stores for branch %s are not listable" % br)
458
class BoundBranchOutOfDate(BzrNewError):
459
"""Bound branch %(branch)s is out of date with master branch %(master)s."""
460
def __init__(self, branch, master):
461
BzrNewError.__init__(self)
466
class CommitToDoubleBoundBranch(BzrNewError):
467
"""Cannot commit to branch %(branch)s. It is bound to %(master)s, which is bound to %(remote)s."""
468
def __init__(self, branch, master, remote):
469
BzrNewError.__init__(self)
475
class OverwriteBoundBranch(BzrNewError):
476
"""Cannot pull --overwrite to a branch which is bound %(branch)s"""
477
def __init__(self, branch):
478
BzrNewError.__init__(self)
482
class BoundBranchConnectionFailure(BzrNewError):
483
"""Unable to connect to target of bound branch %(branch)s => %(target)s: %(error)s"""
484
def __init__(self, branch, target, error):
485
BzrNewError.__init__(self)
353
491
class WeaveError(BzrNewError):
354
492
"""Error in processing weave: %(message)s"""
355
493
def __init__(self, message=None):
398
536
self.weave_b = weave_b
539
class WeaveTextDiffers(WeaveError):
540
"""Weaves differ on text content. Revision: {%(revision_id)s}, %(weave_a)s, %(weave_b)s"""
542
def __init__(self, revision_id, weave_a, weave_b):
543
WeaveError.__init__(self)
544
self.revision_id = revision_id
545
self.weave_a = weave_a
546
self.weave_b = weave_b
401
549
class NoSuchExportFormat(BzrNewError):
402
550
"""Export format %(format)r not supported"""
403
551
def __init__(self, format):
437
586
"""The connection has been closed."""
440
590
class ConflictsInTree(BzrError):
441
591
def __init__(self):
442
592
BzrError.__init__(self, "Working tree has conflicts.")
444
595
class ParseConfigError(BzrError):
445
596
def __init__(self, errors, filename):
446
597
if filename is None:
449
600
(filename, ('\n'.join(e.message for e in errors)))
450
601
BzrError.__init__(self, message)
452
604
class SigningFailed(BzrError):
453
605
def __init__(self, command_line):
454
606
BzrError.__init__(self, "Failed to gpg sign data with command '%s'"
457
610
class WorkingTreeNotRevision(BzrError):
458
611
def __init__(self, tree):
459
612
BzrError.__init__(self, "The working tree for %s has changed since"
460
613
" last commit, but weave merge requires that it be"
461
614
" unchanged." % tree.basedir)
463
617
class CantReprocessAndShowBase(BzrNewError):
464
618
"""Can't reprocess and show base.
465
619
Reprocessing obscures relationship of conflicting lines to base."""
467
622
class GraphCycleError(BzrNewError):
468
623
"""Cycle in graph %(graph)r"""
469
624
def __init__(self, graph):
497
652
self.file_id = file_id
655
class DuplicateKey(BzrNewError):
656
"""Key %(key)s is already present in map"""
659
class MalformedTransform(BzrNewError):
660
"""Tree transform is malformed %(conflicts)r"""
500
663
class BzrBadParameter(BzrNewError):
501
664
"""A bad parameter : %(param)s is not usable.
512
675
"""Parameter %(param)s is neither unicode nor utf8."""
678
class ReusingTransform(BzrNewError):
679
"""Attempt to reuse a transform that has already been applied."""
682
class CantMoveRoot(BzrNewError):
683
"""Moving the root directory is not supported at this time"""
515
686
class BzrBadParameterNotString(BzrBadParameter):
516
687
"""Parameter %(param)s is not a string or unicode string."""
690
class BzrBadParameterMissing(BzrBadParameter):
691
"""Parameter $(param)s is required but not present."""
519
694
class DependencyNotPresent(BzrNewError):
520
695
"""Unable to import library "%(library)s": %(error)s"""
536
711
def __init__(self, format):
537
712
BzrNewError.__init__(self)
538
713
self.format = format
716
class NoDiff3(BzrNewError):
717
"""Diff3 is not installed on this machine."""
720
class ExistingLimbo(BzrNewError):
721
"""This tree contains left-over files from a failed operation.
722
Please examine %(limbo_dir)s to see if it contains any files you wish to
723
keep, and delete it when you are done.
725
def __init__(self, limbo_dir):
726
BzrNewError.__init__(self)
727
self.limbo_dir = limbo_dir
730
class ImmortalLimbo(BzrNewError):
731
"""Unable to delete transform temporary directory $(limbo_dir)s.
732
Please examine %(limbo_dir)s to see if it contains any files you wish to
733
keep, and delete it when you are done.
735
def __init__(self, limbo_dir):
736
BzrNewError.__init__(self)
737
self.limbo_dir = limbo_dir
740
class OutOfDateTree(BzrNewError):
741
"""Working tree is out of date, please run 'bzr update'."""
743
def __init__(self, tree):
744
BzrNewError.__init__(self)
748
class CorruptRepository(BzrNewError):
749
"""An error has been detected in the repository %(repo_path)s.
750
Please run bzr reconcile on this repository."""
752
def __init__(self, repo):
753
BzrNewError.__init__(self)
754
self.repo_path = repo.bzrdir.root_transport.base
757
class UpgradeRequired(BzrNewError):
758
"""To use this feature you must upgrade your branch at %(path)s."""
760
def __init__(self, path):
761
BzrNewError.__init__(self)
765
class LocalRequiresBoundBranch(BzrNewError):
766
"""Cannot perform local-only commits on unbound branches."""