259
259
BzrError.__init__(self, branch_url=public_location)
262
class NoHelpTopic(BzrError):
264
_fmt = ("No help could be found for '%(topic)s'. "
265
"Please use 'brz help topics' to obtain a list of topics.")
267
def __init__(self, topic):
271
262
class NoSuchId(BzrError):
273
264
_fmt = 'The file id "%(file_id)s" is not present in the tree %(tree)s.'
351
342
self.not_locked = not_locked
354
class BzrOptionError(BzrCommandError):
356
_fmt = "Error in command line options"
359
345
class BadIndexFormatSignature(BzrError):
361
347
_fmt = "%(value)s is not an index of type %(_type)s."
412
398
self.value = value
415
class BadOptionValue(BzrError):
417
_fmt = """Bad value "%(value)s" for option "%(name)s"."""
419
def __init__(self, name, value):
420
BzrError.__init__(self, name=name, value=value)
423
401
class StrictCommitFailed(BzrError):
425
403
_fmt = "Commit refused because there are unknown files in the tree"
511
489
_fmt = 'Permission denied: "%(path)s"%(extra)s'
514
class InvalidURL(PathError):
516
_fmt = 'Invalid url supplied to transport: "%(path)s"%(extra)s'
519
class InvalidURLJoin(PathError):
521
_fmt = "Invalid URL join request: %(reason)s: %(base)r + %(join_args)r"
523
def __init__(self, reason, base, join_args):
526
self.join_args = join_args
527
PathError.__init__(self, base, reason)
530
class InvalidRebaseURLs(PathError):
532
_fmt = "URLs differ by more than path: %(from_)r and %(to)r"
534
def __init__(self, from_, to):
537
PathError.__init__(self, from_, 'URLs differ by more than path.')
540
492
class UnavailableRepresentation(InternalBzrError):
542
494
_fmt = ("The encoding '%(wanted)s' is not available for key %(key)s which "
1314
1266
self.error = error
1317
class WeaveError(BzrError):
1319
_fmt = "Error in processing weave: %(msg)s"
1321
def __init__(self, msg=None):
1322
BzrError.__init__(self)
1326
class WeaveRevisionAlreadyPresent(WeaveError):
1328
_fmt = "Revision {%(revision_id)s} already present in %(weave)s"
1330
def __init__(self, revision_id, weave):
1332
WeaveError.__init__(self)
1333
self.revision_id = revision_id
1337
class WeaveRevisionNotPresent(WeaveError):
1339
_fmt = "Revision {%(revision_id)s} not present in %(weave)s"
1341
def __init__(self, revision_id, weave):
1342
WeaveError.__init__(self)
1343
self.revision_id = revision_id
1347
class WeaveFormatError(WeaveError):
1349
_fmt = "Weave invariant violated: %(what)s"
1351
def __init__(self, what):
1352
WeaveError.__init__(self)
1356
class WeaveParentMismatch(WeaveError):
1358
_fmt = "Parents are mismatched between two revisions. %(msg)s"
1361
class WeaveInvalidChecksum(WeaveError):
1363
_fmt = "Text did not match its checksum: %(msg)s"
1366
class WeaveTextDiffers(WeaveError):
1368
_fmt = ("Weaves differ on text content. Revision:"
1369
" {%(revision_id)s}, %(weave_a)s, %(weave_b)s")
1371
def __init__(self, revision_id, weave_a, weave_b):
1372
WeaveError.__init__(self)
1373
self.revision_id = revision_id
1374
self.weave_a = weave_a
1375
self.weave_b = weave_b
1378
class WeaveTextDiffers(WeaveError):
1380
_fmt = ("Weaves differ on text content. Revision:"
1381
" {%(revision_id)s}, %(weave_a)s, %(weave_b)s")
1383
def __init__(self, revision_id, weave_a, weave_b):
1384
WeaveError.__init__(self)
1385
self.revision_id = revision_id
1386
self.weave_a = weave_a
1387
self.weave_b = weave_b
1390
1269
class VersionedFileError(BzrError):
1392
1271
_fmt = "Versioned file error"
1734
1613
_fmt = "Working tree has conflicts."
1737
class ConfigContentError(BzrError):
1739
_fmt = "Config file %(filename)s is not UTF-8 encoded\n"
1741
def __init__(self, filename):
1742
BzrError.__init__(self)
1743
self.filename = filename
1746
class ParseConfigError(BzrError):
1748
_fmt = "Error(s) parsing config file %(filename)s:\n%(errors)s"
1750
def __init__(self, errors, filename):
1751
BzrError.__init__(self)
1752
self.filename = filename
1753
self.errors = '\n'.join(e.msg for e in errors)
1756
class ConfigOptionValueError(BzrError):
1758
_fmt = ('Bad value "%(value)s" for option "%(name)s".\n'
1759
'See ``brz help %(name)s``')
1761
def __init__(self, name, value):
1762
BzrError.__init__(self, name=name, value=value)
1765
class NoEmailInUsername(BzrError):
1767
_fmt = "%(username)r does not seem to contain a reasonable email address"
1769
def __init__(self, username):
1770
BzrError.__init__(self)
1771
self.username = username
1774
class SigningFailed(BzrError):
1776
_fmt = 'Failed to GPG sign data with command "%(command_line)s"'
1778
def __init__(self, command_line):
1779
BzrError.__init__(self, command_line=command_line)
1782
class SignatureVerificationFailed(BzrError):
1784
_fmt = 'Failed to verify GPG signature data with error "%(error)s"'
1786
def __init__(self, error):
1787
BzrError.__init__(self, error=error)
1790
1616
class DependencyNotPresent(BzrError):
1792
1618
_fmt = 'Unable to import library "%(library)s": %(error)s'
1795
1621
BzrError.__init__(self, library=library, error=error)
1798
class GpgmeNotInstalled(DependencyNotPresent):
1800
_fmt = 'python-gpgme is not installed, it is needed to verify signatures'
1802
def __init__(self, error):
1803
DependencyNotPresent.__init__(self, 'gpgme', error)
1806
1624
class WorkingTreeNotRevision(BzrError):
1808
1626
_fmt = ("The working tree for %(basedir)s has changed since"
2582
2400
self.tag_name = tag_name
2585
class MalformedBugIdentifier(BzrError):
2587
_fmt = ('Did not understand bug identifier %(bug_id)s: %(reason)s. '
2588
'See "brz help bugs" for more information on this feature.')
2590
def __init__(self, bug_id, reason):
2591
self.bug_id = bug_id
2592
self.reason = reason
2595
class InvalidBugTrackerURL(BzrError):
2597
_fmt = ("The URL for bug tracker \"%(abbreviation)s\" doesn't "
2598
"contain {id}: %(url)s")
2600
def __init__(self, abbreviation, url):
2601
self.abbreviation = abbreviation
2605
class UnknownBugTrackerAbbreviation(BzrError):
2607
_fmt = ("Cannot find registered bug tracker called %(abbreviation)s "
2610
def __init__(self, abbreviation, branch):
2611
self.abbreviation = abbreviation
2612
self.branch = branch
2615
class InvalidLineInBugsProperty(BzrError):
2617
_fmt = ("Invalid line in bugs property: '%(line)s'")
2619
def __init__(self, line):
2623
class InvalidBugStatus(BzrError):
2625
_fmt = ("Invalid bug status: '%(status)s'")
2627
def __init__(self, status):
2628
self.status = status
2631
2403
class UnexpectedSmartServerResponse(BzrError):
2633
2405
_fmt = "Could not understand response from smart server: %(response_tuple)r"
2973
2745
self.user_encoding = get_user_encoding()
2976
class NoSuchConfig(BzrError):
2978
_fmt = ('The "%(config_id)s" configuration does not exist.')
2980
def __init__(self, config_id):
2981
BzrError.__init__(self, config_id=config_id)
2984
class NoSuchConfigOption(BzrError):
2986
_fmt = ('The "%(option_name)s" configuration option does not exist.')
2988
def __init__(self, option_name):
2989
BzrError.__init__(self, option_name=option_name)
2992
2748
class NoSuchAlias(BzrError):
2994
2750
_fmt = ('The alias "%(alias_name)s" does not exist.')
3180
2936
self.target_branch = target_branch
3183
class FileTimestampUnavailable(BzrError):
3185
_fmt = "The filestamp for %(path)s is not available."
3187
internal_error = True
3189
def __init__(self, path):
3193
2939
class NoColocatedBranchSupport(BzrError):
3195
2941
_fmt = ("%(controldir)r does not support co-located branches.")
3198
2944
self.controldir = controldir
3201
class NoWhoami(BzrError):
3203
_fmt = ('Unable to determine your name.\n'
3204
"Please, set your name with the 'whoami' command.\n"
3205
'E.g. brz whoami "Your Name <name@example.com>"')
3208
class InvalidPattern(BzrError):
3210
_fmt = ('Invalid pattern(s) found. %(msg)s')
3212
def __init__(self, msg):
3216
2947
class RecursiveBind(BzrError):
3218
2949
_fmt = ('Branch "%(branch_url)s" appears to be bound to itself. '
3222
2953
self.branch_url = branch_url
3225
# FIXME: I would prefer to define the config related exception classes in
3226
# config.py but the lazy import mechanism proscribes this -- vila 20101222
3227
class OptionExpansionLoop(BzrError):
3229
_fmt = 'Loop involving %(refs)r while expanding "%(string)s".'
3231
def __init__(self, string, refs):
3232
self.string = string
3233
self.refs = '->'.join(refs)
3236
class ExpandingUnknownOption(BzrError):
3238
_fmt = 'Option "%(name)s" is not defined while expanding "%(string)s".'
3240
def __init__(self, name, string):
3242
self.string = string
3245
class IllegalOptionName(BzrError):
3247
_fmt = 'Option "%(name)s" is not allowed.'
3249
def __init__(self, name):
3253
class NoCompatibleInter(BzrError):
3255
_fmt = ('No compatible object available for operations from %(source)r '
3258
def __init__(self, source, target):
3259
self.source = source
3260
self.target = target
3263
2956
class HpssVfsRequestNotAllowed(BzrError):
3265
2958
_fmt = ("VFS requests over the smart server are not allowed. Encountered: "
3282
2975
self.format = format
3285
class MissingFeature(BzrError):
3287
_fmt = ("Missing feature %(feature)s not provided by this "
3288
"version of Bazaar or any plugin.")
3290
def __init__(self, feature):
3291
self.feature = feature
3294
class PatchSyntax(BzrError):
3295
"""Base class for patch syntax errors."""
3298
class BinaryFiles(BzrError):
3300
_fmt = 'Binary files section encountered.'
3302
def __init__(self, orig_name, mod_name):
3303
self.orig_name = orig_name
3304
self.mod_name = mod_name
3307
class MalformedPatchHeader(PatchSyntax):
3309
_fmt = "Malformed patch header. %(desc)s\n%(line)r"
3311
def __init__(self, desc, line):
3316
class MalformedHunkHeader(PatchSyntax):
3318
_fmt = "Malformed hunk header. %(desc)s\n%(line)r"
3320
def __init__(self, desc, line):
3325
class MalformedLine(PatchSyntax):
3327
_fmt = "Malformed line. %(desc)s\n%(line)r"
3329
def __init__(self, desc, line):
3334
class PatchConflict(BzrError):
3336
_fmt = ('Text contents mismatch at line %(line_no)d. Original has '
3337
'"%(orig_line)s", but patch says it should be "%(patch_line)s"')
3339
def __init__(self, line_no, orig_line, patch_line):
3340
self.line_no = line_no
3341
self.orig_line = orig_line.rstrip('\n')
3342
self.patch_line = patch_line.rstrip('\n')
3345
2978
class FeatureAlreadyRegistered(BzrError):
3347
2980
_fmt = 'The feature %(feature)s has already been registered.'