215
class NoRepositoryPresent(BzrNewError):
216
"""Not repository present: %(path)r"""
217
def __init__(self, bzrdir):
218
BzrNewError.__init__(self)
219
self.path = bzrdir.transport.clone('..').base
206
222
class FileInWrongBranch(BzrNewError):
207
223
"""File %(path)s in not in branch %(branch_base)s."""
208
225
def __init__(self, branch, path):
209
226
BzrNewError.__init__(self)
210
227
self.branch = branch
215
232
class UnsupportedFormatError(BzrError):
216
"""Specified path is a bzr branch that we cannot read."""
233
"""Specified path is a bzr branch that we recognize but cannot read."""
217
234
def __str__(self):
218
235
return 'unsupported branch format: %s' % self.args[0]
238
class UnknownFormatError(BzrError):
239
"""Specified path is a bzr branch whose format we do not recognize."""
241
return 'unknown branch format: %s' % self.args[0]
244
class IncompatibleFormat(BzrNewError):
245
"""Format %(format)s is not compatible with .bzr version %(bzrdir)s."""
247
def __init__(self, format, bzrdir_format):
248
BzrNewError.__init__(self)
250
self.bzrdir = bzrdir_format
221
253
class NotVersionedError(BzrNewError):
222
254
"""%(path)s is not versioned"""
223
255
def __init__(self, path):
257
289
class PointlessCommit(BzrNewError):
258
290
"""No changes to commit"""
293
class UpgradeReadonly(BzrNewError):
294
"""Upgrade URL cannot work with readonly URL's."""
297
class UpToDateFormat(BzrNewError):
298
"""The branch format %(format)s is already at the most recent format."""
300
def __init__(self, format):
301
BzrNewError.__init__(self)
260
305
class StrictCommitFailed(Exception):
261
306
"""Commit refused because there are unknowns in the tree."""
290
335
BzrCommandError.__init__(self, msg)
292
338
class NoCommonAncestor(BzrError):
293
339
def __init__(self, revision_a, revision_b):
294
340
msg = "Revisions have no common ancestor: %s %s." \
295
341
% (revision_a, revision_b)
296
342
BzrError.__init__(self, msg)
298
345
class NoCommonRoot(BzrError):
299
346
def __init__(self, revision_a, revision_b):
300
347
msg = "Revisions are not derived from the same root: %s %s." \
301
348
% (revision_a, revision_b)
302
349
BzrError.__init__(self, msg)
304
352
class NotAncestor(BzrError):
305
353
def __init__(self, rev_id, not_ancestor_id):
306
354
msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id,
324
372
BzrError.__init__(self, msg)
325
373
self.bases = bases
327
376
class NoCommits(BzrError):
328
377
def __init__(self, branch):
329
378
msg = "Branch %s has no commits." % branch
330
379
BzrError.__init__(self, msg)
332
382
class UnlistableStore(BzrError):
333
383
def __init__(self, store):
334
384
BzrError.__init__(self, "Store %s is not listable" % store)
336
387
class UnlistableBranch(BzrError):
337
388
def __init__(self, br):
338
389
BzrError.__init__(self, "Stores for branch %s are not listable" % br)
376
427
"""Text did not match it's checksum: %(message)s"""
430
class WeaveTextDiffers(WeaveError):
431
"""Weaves differ on text content. Revision: {%(revision_id)s}, %(weave_a)s, %(weave_b)s"""
433
def __init__(self, revision_id, weave_a, weave_b):
434
WeaveError.__init__(self)
435
self.revision_id = revision_id
436
self.weave_a = weave_a
437
self.weave_b = weave_b
440
class WeaveTextDiffers(WeaveError):
441
"""Weaves differ on text content. Revision: {%(revision_id)s}, %(weave_a)s, %(weave_b)s"""
443
def __init__(self, revision_id, weave_a, weave_b):
444
WeaveError.__init__(self)
445
self.revision_id = revision_id
446
self.weave_a = weave_a
447
self.weave_b = weave_b
379
450
class NoSuchExportFormat(BzrNewError):
380
451
"""Export format %(format)r not supported"""
381
452
def __init__(self, format):
427
501
(filename, ('\n'.join(e.message for e in errors)))
428
502
BzrError.__init__(self, message)
430
505
class SigningFailed(BzrError):
431
506
def __init__(self, command_line):
432
507
BzrError.__init__(self, "Failed to gpg sign data with command '%s'"
435
511
class WorkingTreeNotRevision(BzrError):
436
512
def __init__(self, tree):
437
513
BzrError.__init__(self, "The working tree for %s has changed since"
438
514
" last commit, but weave merge requires that it be"
439
515
" unchanged." % tree.basedir)
441
518
class CantReprocessAndShowBase(BzrNewError):
442
519
"""Can't reprocess and show base.
443
520
Reprocessing obscures relationship of conflicting lines to base."""
445
523
class GraphCycleError(BzrNewError):
446
524
"""Cycle in graph %(graph)r"""
447
525
def __init__(self, graph):
473
552
self.text_revision = text_revision
474
553
self.file_id = file_id
555
class DuplicateKey(BzrNewError):
556
"""Key %(key)s is already present in map"""
558
class MalformedTransform(BzrNewError):
559
"""Tree transform is malformed %(conflicts)r"""
477
562
class BzrBadParameter(BzrNewError):
478
"""Parameter %(param)s is neither unicode nor utf8."""
563
"""A bad parameter : %(param)s is not usable.
565
This exception should never be thrown, but it is a base class for all
566
parameter-to-function errors.
480
568
def __init__(self, param):
481
569
BzrNewError.__init__(self)
482
570
self.param = param
573
class BzrBadParameterNotUnicode(BzrBadParameter):
574
"""Parameter %(param)s is neither unicode nor utf8."""
577
class ReusingTransform(BzrNewError):
578
"""Attempt to reuse a transform that has already been applied."""
581
class CantMoveRoot(BzrNewError):
582
"""Moving the root directory is not supported at this time"""
585
class BzrBadParameterNotString(BzrBadParameter):
586
"""Parameter %(param)s is not a string or unicode string."""
589
class BzrBadParameterMissing(BzrBadParameter):
590
"""Parameter $(param)s is required but not present."""
593
class DependencyNotPresent(BzrNewError):
594
"""Unable to import library: %(library)s, %(error)s"""
596
def __init__(self, library, error):
597
BzrNewError.__init__(self, library=library, error=error)
600
class ParamikoNotPresent(DependencyNotPresent):
601
"""Unable to import paramiko (required for sftp support): %(error)s"""
603
def __init__(self, error):
604
DependencyNotPresent.__init__(self, 'paramiko', error)
607
class UninitializableFormat(BzrNewError):
608
"""Format %(format)s cannot be initialised by this version of bzr."""
610
def __init__(self, format):
611
BzrNewError.__init__(self)
615
class NoDiff3(BzrNewError):
616
"""Diff3 is not installed on this machine."""
619
class ExistingLimbo(BzrNewError):
620
"""This tree contains left-over files from a failed operation.
621
Please examine %(limbo_dir)s to see if it contains any files you wish to
622
keep, and delete it when you are done.
624
def __init__(self, limbo_dir):
625
BzrNewError.__init__(self)
626
self.limbo_dir = limbo_dir
629
class ImmortalLimbo(BzrNewError):
630
"""Unable to delete transform temporary directory $(limbo_dir)s.
631
Please examine %(limbo_dir)s to see if it contains any files you wish to
632
keep, and delete it when you are done.
634
def __init__(self, limbo_dir):
635
BzrNewError.__init__(self)
636
self.limbo_dir = limbo_dir
639
class OutOfDateTree(BzrNewError):
640
"""Working tree is out of date, please run 'bzr update'."""
642
def __init__(self, tree):
643
BzrNewError.__init__(self)