3089
3089
self.format = format
3092
class PatchSyntax(BzrError):
3093
"""Base class for patch syntax errors."""
3096
class BinaryFiles(BzrError):
3098
_fmt = 'Binary files section encountered.'
3100
def __init__(self, orig_name, mod_name):
3101
self.orig_name = orig_name
3102
self.mod_name = mod_name
3105
class MalformedPatchHeader(PatchSyntax):
3107
_fmt = "Malformed patch header. %(desc)s\n%(line)r"
3109
def __init__(self, desc, line):
3114
class MalformedHunkHeader(PatchSyntax):
3116
_fmt = "Malformed hunk header. %(desc)s\n%(line)r"
3118
def __init__(self, desc, line):
3123
class MalformedLine(PatchSyntax):
3125
_fmt = "Malformed line. %(desc)s\n%(line)r"
3127
def __init__(self, desc, line):
3132
class PatchConflict(BzrError):
3134
_fmt = ('Text contents mismatch at line %(line_no)d. Original has '
3135
'"%(orig_line)s", but patch says it should be "%(patch_line)s"')
3137
def __init__(self, line_no, orig_line, patch_line):
3138
self.line_no = line_no
3139
self.orig_line = orig_line.rstrip('\n')
3140
self.patch_line = patch_line.rstrip('\n')
3143
3092
class FeatureAlreadyRegistered(BzrError):
3145
3094
_fmt = 'The feature %(feature)s has already been registered.'