165
class DirstateCorrupt(BzrError):
167
_fmt = "The dirstate file (%(state)s) appears to be corrupt: %(msg)s"
169
def __init__(self, state, msg):
170
BzrError.__init__(self)
175
165
class IncompatibleVersion(BzrError):
177
167
_fmt = 'API %(api)s is not compatible; one of versions %(wanted)r '\
323
313
self.not_locked = not_locked
326
class BadIndexFormatSignature(BzrError):
328
_fmt = "%(value)s is not an index of type %(_type)s."
330
def __init__(self, value, _type):
331
BzrError.__init__(self)
336
class BadIndexData(BzrError):
338
_fmt = "Error in data for index %(value)s."
340
def __init__(self, value):
341
BzrError.__init__(self)
345
class BadIndexDuplicateKey(BzrError):
347
_fmt = "The key '%(key)s' is already in index '%(index)s'."
349
def __init__(self, key, index):
350
BzrError.__init__(self)
355
class BadIndexKey(BzrError):
357
_fmt = "The key '%(key)s' is not a valid key."
359
def __init__(self, key):
360
BzrError.__init__(self)
364
class BadIndexOptions(BzrError):
366
_fmt = "Could not parse options for index %(value)s."
368
def __init__(self, value):
369
BzrError.__init__(self)
373
class BadIndexValue(BzrError):
375
_fmt = "The value '%(value)s' is not a valid value."
377
def __init__(self, value):
378
BzrError.__init__(self)
382
316
class StrictCommitFailed(BzrError):
384
318
_fmt = "Commit refused because there are unknown files in the tree"
485
class UnknownHook(BzrError):
487
_fmt = "The %(type)s hook '%(hook)s' is unknown in this version of breezy."
489
def __init__(self, hook_type, hook_name):
490
BzrError.__init__(self)
491
self.type = hook_type
492
self.hook = hook_name
495
419
class UnsupportedProtocol(PathError):
497
421
_fmt = 'Unsupported protocol for url "%(path)s"%(extra)s'
500
424
PathError.__init__(self, url, extra=extra)
503
class UnstackableBranchFormat(BzrError):
505
_fmt = ("The branch '%(url)s'(%(format)s) is not a stackable format. "
506
"You will need to upgrade the branch to permit branch stacking.")
508
def __init__(self, format, url):
509
BzrError.__init__(self)
514
427
class UnstackableLocationError(BzrError):
516
429
_fmt = "The branch '%(branch_url)s' cannot be stacked on '%(target_url)s'."
1018
931
self.lock_token = lock_token
1021
class PointlessCommit(BzrError):
1023
_fmt = "No changes to commit"
1026
class CannotCommitSelectedFileMerge(BzrError):
1028
_fmt = 'Selected-file commit of merges is not supported yet:'\
1029
' files %(files_str)s'
1031
def __init__(self, files):
1032
files_str = ', '.join(files)
1033
BzrError.__init__(self, files=files, files_str=files_str)
1036
class ExcludesUnsupported(BzrError):
1038
_fmt = ('Excluding paths during commit is not supported by '
1039
'repository at %(repository)r.')
1041
def __init__(self, repository):
1042
BzrError.__init__(self, repository=repository)
1045
class BadCommitMessageEncoding(BzrError):
1047
_fmt = 'The specified commit message contains characters unsupported by '\
1048
'the current encoding.'
1051
934
class UpgradeReadonly(BzrError):
1053
936
_fmt = "Upgrade URL cannot work with readonly URLs."
1992
1870
_fmt = "Format error in conflict listings"
1995
class CorruptDirstate(BzrError):
1997
_fmt = ("Inconsistency in dirstate file %(dirstate_path)s.\n"
1998
"Error: %(description)s")
2000
def __init__(self, dirstate_path, description):
2001
BzrError.__init__(self)
2002
self.dirstate_path = dirstate_path
2003
self.description = description
2006
1873
class CorruptRepository(BzrError):
2008
1875
_fmt = ("An error has been detected in the repository %(repo_path)s.\n"
2492
2359
self.reason = reason
2495
class BzrDirError(BzrError):
2497
def __init__(self, controldir):
2498
from . import urlutils
2499
display_url = urlutils.unescape_for_display(controldir.user_url,
2501
BzrError.__init__(self, controldir=controldir, display_url=display_url)
2504
class UnsyncedBranches(BzrDirError):
2506
_fmt = ("'%(display_url)s' is not in sync with %(target_url)s. See"
2507
" brz help sync-for-reconfigure.")
2509
def __init__(self, controldir, target_branch):
2510
BzrError.__init__(self, controldir)
2511
from . import urlutils
2512
self.target_url = urlutils.unescape_for_display(target_branch.base,
2516
class AlreadyBranch(BzrDirError):
2518
_fmt = "'%(display_url)s' is already a branch."
2521
class AlreadyTree(BzrDirError):
2523
_fmt = "'%(display_url)s' is already a tree."
2526
class AlreadyCheckout(BzrDirError):
2528
_fmt = "'%(display_url)s' is already a checkout."
2531
class AlreadyLightweightCheckout(BzrDirError):
2533
_fmt = "'%(display_url)s' is already a lightweight checkout."
2536
class AlreadyUsingShared(BzrDirError):
2538
_fmt = "'%(display_url)s' is already using a shared repository."
2541
class AlreadyStandalone(BzrDirError):
2543
_fmt = "'%(display_url)s' is already standalone."
2546
class AlreadyWithTrees(BzrDirError):
2548
_fmt = ("Shared repository '%(display_url)s' already creates "
2552
class AlreadyWithNoTrees(BzrDirError):
2554
_fmt = ("Shared repository '%(display_url)s' already doesn't create "
2558
class ReconfigurationNotSupported(BzrDirError):
2560
_fmt = "Requested reconfiguration of '%(display_url)s' is not supported."
2563
class NoBindLocation(BzrDirError):
2565
_fmt = "No location could be found to bind to at %(display_url)s."
2568
2362
class UncommittedChanges(BzrError):
2570
2364
_fmt = ('Working tree "%(display_url)s" has uncommitted changes'
2605
2399
' (See brz shelve --list).%(more)s')
2608
class MissingTemplateVariable(BzrError):
2610
_fmt = 'Variable {%(name)s} is not available.'
2612
def __init__(self, name):
2616
class NoTemplate(BzrError):
2618
_fmt = 'No template specified.'
2621
2402
class UnableCreateSymlink(BzrError):
2623
2404
_fmt = 'Unable to create symlink %(path_str)son this platform'
2633
2414
self.path_str = path_str
2636
class UnsupportedTimezoneFormat(BzrError):
2638
_fmt = ('Unsupported timezone format "%(timezone)s", '
2639
'options are "utc", "original", "local".')
2641
def __init__(self, timezone):
2642
self.timezone = timezone
2645
2417
class UnableEncodePath(BzrError):
2647
2419
_fmt = ('Unable to encode %(kind)s path %(path)r in '
2662
2434
BzrError.__init__(self, alias_name=alias_name)
2665
class DirectoryLookupFailure(BzrError):
2666
"""Base type for lookup errors."""
2671
class InvalidLocationAlias(DirectoryLookupFailure):
2673
_fmt = '"%(alias_name)s" is not a valid location alias.'
2675
def __init__(self, alias_name):
2676
DirectoryLookupFailure.__init__(self, alias_name=alias_name)
2679
class UnsetLocationAlias(DirectoryLookupFailure):
2681
_fmt = 'No %(alias_name)s location assigned.'
2683
def __init__(self, alias_name):
2684
DirectoryLookupFailure.__init__(self, alias_name=alias_name[1:])
2687
2437
class CannotBindAddress(BzrError):
2689
2439
_fmt = 'Cannot bind address "%(host)s:%(port)i": %(orig_error)s.'
2694
2444
orig_error=repr(orig_error.args))
2697
class UnknownRules(BzrError):
2699
_fmt = ('Unknown rules detected: %(unknowns_str)s.')
2701
def __init__(self, unknowns):
2702
BzrError.__init__(self, unknowns_str=", ".join(unknowns))
2705
2447
class TipChangeRejected(BzrError):
2706
2448
"""A pre_change_branch_tip hook function may raise this to cleanly and
2707
2449
explicitly abort a change to a branch tip.
2716
class DecompressCorruption(BzrError):
2718
_fmt = "Corruption while decompressing repository file%(orig_error)s"
2720
def __init__(self, orig_error=None):
2721
if orig_error is not None:
2722
self.orig_error = ", %s" % (orig_error,)
2724
self.orig_error = ""
2725
BzrError.__init__(self)
2728
2458
class JailBreak(BzrError):
2730
2460
_fmt = "An attempt to access a url outside the server jail was made: '%(url)s'."
2738
2468
_fmt = 'The user aborted the operation.'
2741
class MustHaveWorkingTree(BzrError):
2743
_fmt = ("Branching '%(url)s'(%(format)s) must create a working tree.")
2745
def __init__(self, format, url):
2746
BzrError.__init__(self, format=format, url=url)
2749
2471
class UnresumableWriteGroup(BzrError):
2751
2473
_fmt = ("Repository %(repository)s cannot resume write group "
2822
2544
self.format = format
2825
class FeatureAlreadyRegistered(BzrError):
2827
_fmt = 'The feature %(feature)s has already been registered.'
2829
def __init__(self, feature):
2830
self.feature = feature
2833
2547
class ChangesAlreadyStored(BzrCommandError):
2835
2549
_fmt = ('Cannot store uncommitted changes because this branch already'