1667
1661
def __init__(self, exc_info):
1668
1662
import traceback
1663
# GZ 2010-08-10: Cycle with exc_tb/exc_info affects at least one test
1669
1664
self.exc_type, self.exc_value, self.exc_tb = exc_info
1670
1665
self.exc_info = exc_info
1671
1666
traceback_strings = traceback.format_exception(
3354
3349
def __init__(self, method, arguments):
3355
3350
self.method = method
3356
3351
self.arguments = arguments
3354
class UnsupportedKindChange(BzrError):
3356
_fmt = ("Kind change from %(from_kind)s to %(to_kind)s for "
3357
"%(path)s not supported by format %(format)r")
3359
def __init__(self, path, from_kind, to_kind, format):
3361
self.from_kind = from_kind
3362
self.to_kind = to_kind
3363
self.format = format
3366
class PatchSyntax(BzrError):
3367
"""Base class for patch syntax errors."""
3370
class BinaryFiles(BzrError):
3372
_fmt = 'Binary files section encountered.'
3374
def __init__(self, orig_name, mod_name):
3375
self.orig_name = orig_name
3376
self.mod_name = mod_name
3379
class MalformedPatchHeader(PatchSyntax):
3381
_fmt = "Malformed patch header. %(desc)s\n%(line)r"
3383
def __init__(self, desc, line):
3388
class MalformedHunkHeader(PatchSyntax):
3390
_fmt = "Malformed hunk header. %(desc)s\n%(line)r"
3392
def __init__(self, desc, line):
3397
class MalformedLine(PatchSyntax):
3399
_fmt = "Malformed line. %(desc)s\n%(line)r"
3401
def __init__(self, desc, line):
3406
class PatchConflict(BzrError):
3408
_fmt = ('Text contents mismatch at line %(line_no)d. Original has '
3409
'"%(orig_line)s", but patch says it should be "%(patch_line)s"')
3411
def __init__(self, line_no, orig_line, patch_line):
3412
self.line_no = line_no
3413
self.orig_line = orig_line.rstrip('\n')
3414
self.patch_line = patch_line.rstrip('\n')