106
106
class BzrCheckError(BzrNewError):
107
107
"""Internal check failed: %(message)s"""
108
109
def __init__(self, message):
109
110
BzrNewError.__init__(self)
110
111
self.message = message
144
class NotLocalUrl(BzrNewError):
145
"""%s(url) is not a local path."""
147
def __init__(self, url):
148
BzrNewError.__init__(self)
143
152
class BzrCommandError(BzrError):
144
153
# Error from malformed user command
145
154
# This is being misused as a generic exception
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
210
226
class FileInWrongBranch(BzrNewError):
211
227
"""File %(path)s in not in branch %(branch_base)s."""
212
229
def __init__(self, branch, path):
213
230
BzrNewError.__init__(self)
214
231
self.branch = branch
228
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
231
257
class NotVersionedError(BzrNewError):
232
258
"""%(path)s is not versioned"""
233
259
def __init__(self, path):
334
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)
337
371
class StrictCommitFailed(Exception):
338
372
"""Commit refused because there are unknowns in the tree."""
341
374
class NoSuchRevision(BzrError):
342
375
def __init__(self, branch, revision):
343
376
self.branch = branch
368
401
BzrCommandError.__init__(self, msg)
370
404
class NoCommonAncestor(BzrError):
371
405
def __init__(self, revision_a, revision_b):
372
406
msg = "Revisions have no common ancestor: %s %s." \
373
407
% (revision_a, revision_b)
374
408
BzrError.__init__(self, msg)
376
411
class NoCommonRoot(BzrError):
377
412
def __init__(self, revision_a, revision_b):
378
413
msg = "Revisions are not derived from the same root: %s %s." \
379
414
% (revision_a, revision_b)
380
415
BzrError.__init__(self, msg)
382
418
class NotAncestor(BzrError):
383
419
def __init__(self, rev_id, not_ancestor_id):
384
420
msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id,
402
438
BzrError.__init__(self, msg)
403
439
self.bases = bases
405
442
class NoCommits(BzrError):
406
443
def __init__(self, branch):
407
444
msg = "Branch %s has no commits." % branch
408
445
BzrError.__init__(self, msg)
410
448
class UnlistableStore(BzrError):
411
449
def __init__(self, store):
412
450
BzrError.__init__(self, "Store %s is not listable" % store)
414
453
class UnlistableBranch(BzrError):
415
454
def __init__(self, br):
416
455
BzrError.__init__(self, "Stores for branch %s are not listable" % br)
464
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
467
516
class NoSuchExportFormat(BzrNewError):
468
517
"""Export format %(format)r not supported"""
469
518
def __init__(self, format):
503
553
"""The connection has been closed."""
506
557
class ConflictsInTree(BzrError):
507
558
def __init__(self):
508
559
BzrError.__init__(self, "Working tree has conflicts.")
510
562
class ParseConfigError(BzrError):
511
563
def __init__(self, errors, filename):
512
564
if filename is None:
515
567
(filename, ('\n'.join(e.message for e in errors)))
516
568
BzrError.__init__(self, message)
518
571
class SigningFailed(BzrError):
519
572
def __init__(self, command_line):
520
573
BzrError.__init__(self, "Failed to gpg sign data with command '%s'"
523
577
class WorkingTreeNotRevision(BzrError):
524
578
def __init__(self, tree):
525
579
BzrError.__init__(self, "The working tree for %s has changed since"
526
580
" last commit, but weave merge requires that it be"
527
581
" unchanged." % tree.basedir)
529
584
class CantReprocessAndShowBase(BzrNewError):
530
585
"""Can't reprocess and show base.
531
586
Reprocessing obscures relationship of conflicting lines to base."""
533
589
class GraphCycleError(BzrNewError):
534
590
"""Cycle in graph %(graph)r"""
535
591
def __init__(self, graph):
562
618
self.text_revision = text_revision
563
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"""
566
628
class BzrBadParameter(BzrNewError):
567
629
"""A bad parameter : %(param)s is not usable.
578
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"""
581
651
class BzrBadParameterNotString(BzrBadParameter):
582
652
"""Parameter %(param)s is not a string or unicode string."""
655
class BzrBadParameterMissing(BzrBadParameter):
656
"""Parameter $(param)s is required but not present."""
585
659
class DependencyNotPresent(BzrNewError):
586
660
"""Unable to import library: %(library)s, %(error)s"""
602
676
def __init__(self, format):
603
677
BzrNewError.__init__(self)
604
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)