87
82
for key, value in kwds.items():
88
83
setattr(self, key, value)
91
86
s = getattr(self, '_preformatted_string', None)
93
# contains a preformatted message; must be cast to plain str
88
# contains a preformatted message
96
91
fmt = self._get_format_string()
98
s = fmt % self.__dict__
93
d = dict(self.__dict__)
99
95
# __str__() should always return a 'str' object
100
96
# never a 'unicode' object.
101
if isinstance(s, unicode):
102
return s.encode('utf8')
104
except (AttributeError, TypeError, NameError, ValueError, KeyError), e:
105
return 'Unprintable exception %s: dict=%r, fmt=%r, error=%s' \
106
% (self.__class__.__name__,
108
getattr(self, '_fmt', None),
99
pass # just bind to 'e' for formatting below
102
return 'Unprintable exception %s: dict=%r, fmt=%r, error=%r' \
103
% (self.__class__.__name__,
105
getattr(self, '_fmt', None),
108
def __unicode__(self):
110
if isinstance(u, str):
111
# Try decoding the str using the default encoding.
113
elif not isinstance(u, unicode):
114
# Try to make a unicode object from it, because __unicode__ must
115
# return a unicode object.
121
if isinstance(s, unicode):
124
# __str__ must return a str.
129
return '%s(%s)' % (self.__class__.__name__, str(self))
111
131
def _get_format_string(self):
112
132
"""Return format string for this exception or None"""
113
133
fmt = getattr(self, '_fmt', None)
114
134
if fmt is not None:
116
fmt = getattr(self, '__doc__', None)
118
symbol_versioning.warn("%s uses its docstring as a format, "
119
"it should use _fmt instead" % self.__class__.__name__,
122
return 'Unprintable exception %s: dict=%r, fmt=%r' \
123
% (self.__class__.__name__,
125
getattr(self, '_fmt', None),
129
class BzrNewError(BzrError):
130
"""Deprecated error base class."""
131
# base classes should override the docstring with their human-
132
# readable explanation
134
def __init__(self, *args, **kwds):
135
# XXX: Use the underlying BzrError to always generate the args
136
# attribute if it doesn't exist. We can't use super here, because
137
# exceptions are old-style classes in python2.4 (but new in 2.5).
139
symbol_versioning.warn('BzrNewError was deprecated in bzr 0.13; '
140
'please convert %s to use BzrError instead'
141
% self.__class__.__name__,
144
BzrError.__init__(self, *args)
145
for key, value in kwds.items():
146
setattr(self, key, value)
150
# __str__() should always return a 'str' object
151
# never a 'unicode' object.
152
s = self.__doc__ % self.__dict__
153
if isinstance(s, unicode):
154
return s.encode('utf8')
156
except (TypeError, NameError, ValueError, KeyError), e:
157
return 'Unprintable exception %s(%r): %s' \
158
% (self.__class__.__name__,
159
self.__dict__, str(e))
135
from bzrlib.i18n import gettext
136
return gettext(unicode(fmt)) # _fmt strings should be ascii
138
def __eq__(self, other):
139
if self.__class__ is not other.__class__:
140
return NotImplemented
141
return self.__dict__ == other.__dict__
144
class InternalBzrError(BzrError):
145
"""Base class for errors that are internal in nature.
147
This is a convenience class for errors that are internal. The
148
internal_error attribute can still be altered in subclasses, if needed.
149
Using this class is simply an easy way to get internal errors.
152
internal_error = True
162
155
class AlreadyBuilding(BzrError):
164
157
_fmt = "The tree builder is already building a tree."
167
class BzrCheckError(BzrError):
169
_fmt = "Internal check failed: %(message)s"
171
internal_error = True
173
def __init__(self, message):
174
BzrError.__init__(self)
175
self.message = message
178
class DisabledMethod(BzrError):
160
class BranchError(BzrError):
161
"""Base class for concrete 'errors about a branch'."""
163
def __init__(self, branch):
164
BzrError.__init__(self, branch=branch)
167
class BzrCheckError(InternalBzrError):
169
_fmt = "Internal check failed: %(msg)s"
171
def __init__(self, msg):
172
BzrError.__init__(self)
176
class DirstateCorrupt(BzrError):
178
_fmt = "The dirstate file (%(state)s) appears to be corrupt: %(msg)s"
180
def __init__(self, state, msg):
181
BzrError.__init__(self)
186
class DisabledMethod(InternalBzrError):
180
188
_fmt = "The smart server method '%(class_name)s' is disabled."
182
internal_error = True
184
190
def __init__(self, class_name):
185
191
BzrError.__init__(self)
186
192
self.class_name = class_name
189
class InvalidEntryName(BzrError):
195
class IncompatibleAPI(BzrError):
197
_fmt = 'The API for "%(api)s" is not compatible with "%(wanted)s". '\
198
'It supports versions "%(minimum)s" to "%(current)s".'
200
def __init__(self, api, wanted, minimum, current):
203
self.minimum = minimum
204
self.current = current
207
class InProcessTransport(BzrError):
209
_fmt = "The transport '%(transport)s' is only accessible within this " \
212
def __init__(self, transport):
213
self.transport = transport
216
class InvalidEntryName(InternalBzrError):
191
218
_fmt = "Invalid entry name: %(name)s"
193
internal_error = True
195
220
def __init__(self, name):
196
221
BzrError.__init__(self)
200
225
class InvalidRevisionNumber(BzrError):
202
227
_fmt = "Invalid revision number %(revno)s"
204
229
def __init__(self, revno):
2039
2588
def __init__(self, branch):
2040
2589
self.branch = branch
2043
2592
class TagAlreadyExists(BzrError):
2045
2594
_fmt = "Tag %(tag_name)s already exists."
2047
2596
def __init__(self, tag_name):
2048
2597
self.tag_name = tag_name
2600
class MalformedBugIdentifier(BzrError):
2602
_fmt = ('Did not understand bug identifier %(bug_id)s: %(reason)s. '
2603
'See "bzr help bugs" for more information on this feature.')
2605
def __init__(self, bug_id, reason):
2606
self.bug_id = bug_id
2607
self.reason = reason
2610
class InvalidBugTrackerURL(BzrError):
2612
_fmt = ("The URL for bug tracker \"%(abbreviation)s\" doesn't "
2613
"contain {id}: %(url)s")
2615
def __init__(self, abbreviation, url):
2616
self.abbreviation = abbreviation
2620
class UnknownBugTrackerAbbreviation(BzrError):
2622
_fmt = ("Cannot find registered bug tracker called %(abbreviation)s "
2625
def __init__(self, abbreviation, branch):
2626
self.abbreviation = abbreviation
2627
self.branch = branch
2630
class InvalidLineInBugsProperty(BzrError):
2632
_fmt = ("Invalid line in bugs property: '%(line)s'")
2634
def __init__(self, line):
2638
class InvalidBugStatus(BzrError):
2640
_fmt = ("Invalid bug status: '%(status)s'")
2642
def __init__(self, status):
2643
self.status = status
2646
class UnexpectedSmartServerResponse(BzrError):
2648
_fmt = "Could not understand response from smart server: %(response_tuple)r"
2650
def __init__(self, response_tuple):
2651
self.response_tuple = response_tuple
2654
class ErrorFromSmartServer(BzrError):
2655
"""An error was received from a smart server.
2657
:seealso: UnknownErrorFromSmartServer
2660
_fmt = "Error received from smart server: %(error_tuple)r"
2662
internal_error = True
2664
def __init__(self, error_tuple):
2665
self.error_tuple = error_tuple
2667
self.error_verb = error_tuple[0]
2669
self.error_verb = None
2670
self.error_args = error_tuple[1:]
2673
class UnknownErrorFromSmartServer(BzrError):
2674
"""An ErrorFromSmartServer could not be translated into a typical bzrlib
2677
This is distinct from ErrorFromSmartServer so that it is possible to
2678
distinguish between the following two cases:
2680
- ErrorFromSmartServer was uncaught. This is logic error in the client
2681
and so should provoke a traceback to the user.
2682
- ErrorFromSmartServer was caught but its error_tuple could not be
2683
translated. This is probably because the server sent us garbage, and
2684
should not provoke a traceback.
2687
_fmt = "Server sent an unexpected error: %(error_tuple)r"
2689
internal_error = False
2691
def __init__(self, error_from_smart_server):
2694
:param error_from_smart_server: An ErrorFromSmartServer instance.
2696
self.error_from_smart_server = error_from_smart_server
2697
self.error_tuple = error_from_smart_server.error_tuple
2700
class ContainerError(BzrError):
2701
"""Base class of container errors."""
2704
class UnknownContainerFormatError(ContainerError):
2706
_fmt = "Unrecognised container format: %(container_format)r"
2708
def __init__(self, container_format):
2709
self.container_format = container_format
2712
class UnexpectedEndOfContainerError(ContainerError):
2714
_fmt = "Unexpected end of container stream"
2717
class UnknownRecordTypeError(ContainerError):
2719
_fmt = "Unknown record type: %(record_type)r"
2721
def __init__(self, record_type):
2722
self.record_type = record_type
2725
class InvalidRecordError(ContainerError):
2727
_fmt = "Invalid record: %(reason)s"
2729
def __init__(self, reason):
2730
self.reason = reason
2733
class ContainerHasExcessDataError(ContainerError):
2735
_fmt = "Container has data after end marker: %(excess)r"
2737
def __init__(self, excess):
2738
self.excess = excess
2741
class DuplicateRecordNameError(ContainerError):
2743
_fmt = "Container has multiple records with the same name: %(name)s"
2745
def __init__(self, name):
2746
self.name = name.decode("utf-8")
2749
class NoDestinationAddress(InternalBzrError):
2751
_fmt = "Message does not have a destination address."
2754
class RepositoryDataStreamError(BzrError):
2756
_fmt = "Corrupt or incompatible data stream: %(reason)s"
2758
def __init__(self, reason):
2759
self.reason = reason
2762
class SMTPError(BzrError):
2764
_fmt = "SMTP error: %(error)s"
2766
def __init__(self, error):
2770
class NoMessageSupplied(BzrError):
2772
_fmt = "No message supplied."
2775
class NoMailAddressSpecified(BzrError):
2777
_fmt = "No mail-to address (--mail-to) or output (-o) specified."
2780
class MailClientNotFound(BzrError):
2782
_fmt = "Unable to find mail client with the following names:"\
2783
" %(mail_command_list_string)s"
2785
def __init__(self, mail_command_list):
2786
mail_command_list_string = ', '.join(mail_command_list)
2787
BzrError.__init__(self, mail_command_list=mail_command_list,
2788
mail_command_list_string=mail_command_list_string)
2790
class SMTPConnectionRefused(SMTPError):
2792
_fmt = "SMTP connection to %(host)s refused"
2794
def __init__(self, error, host):
2799
class DefaultSMTPConnectionRefused(SMTPConnectionRefused):
2801
_fmt = "Please specify smtp_server. No server at default %(host)s."
2804
class BzrDirError(BzrError):
2806
def __init__(self, bzrdir):
2807
import bzrlib.urlutils as urlutils
2808
display_url = urlutils.unescape_for_display(bzrdir.user_url,
2810
BzrError.__init__(self, bzrdir=bzrdir, display_url=display_url)
2813
class UnsyncedBranches(BzrDirError):
2815
_fmt = ("'%(display_url)s' is not in sync with %(target_url)s. See"
2816
" bzr help sync-for-reconfigure.")
2818
def __init__(self, bzrdir, target_branch):
2819
BzrDirError.__init__(self, bzrdir)
2820
import bzrlib.urlutils as urlutils
2821
self.target_url = urlutils.unescape_for_display(target_branch.base,
2825
class AlreadyBranch(BzrDirError):
2827
_fmt = "'%(display_url)s' is already a branch."
2830
class AlreadyTree(BzrDirError):
2832
_fmt = "'%(display_url)s' is already a tree."
2835
class AlreadyCheckout(BzrDirError):
2837
_fmt = "'%(display_url)s' is already a checkout."
2840
class AlreadyLightweightCheckout(BzrDirError):
2842
_fmt = "'%(display_url)s' is already a lightweight checkout."
2845
class AlreadyUsingShared(BzrDirError):
2847
_fmt = "'%(display_url)s' is already using a shared repository."
2850
class AlreadyStandalone(BzrDirError):
2852
_fmt = "'%(display_url)s' is already standalone."
2855
class AlreadyWithTrees(BzrDirError):
2857
_fmt = ("Shared repository '%(display_url)s' already creates "
2861
class AlreadyWithNoTrees(BzrDirError):
2863
_fmt = ("Shared repository '%(display_url)s' already doesn't create "
2867
class ReconfigurationNotSupported(BzrDirError):
2869
_fmt = "Requested reconfiguration of '%(display_url)s' is not supported."
2872
class NoBindLocation(BzrDirError):
2874
_fmt = "No location could be found to bind to at %(display_url)s."
2877
class UncommittedChanges(BzrError):
2879
_fmt = ('Working tree "%(display_url)s" has uncommitted changes'
2880
' (See bzr status).%(more)s')
2882
def __init__(self, tree, more=None):
2887
import bzrlib.urlutils as urlutils
2888
user_url = getattr(tree, "user_url", None)
2889
if user_url is None:
2890
display_url = str(tree)
2892
display_url = urlutils.unescape_for_display(user_url, 'ascii')
2893
BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2896
class StoringUncommittedNotSupported(BzrError):
2898
_fmt = ('Branch "%(display_url)s" does not support storing uncommitted'
2901
def __init__(self, branch):
2902
import bzrlib.urlutils as urlutils
2903
user_url = getattr(branch, "user_url", None)
2904
if user_url is None:
2905
display_url = str(branch)
2907
display_url = urlutils.unescape_for_display(user_url, 'ascii')
2908
BzrError.__init__(self, branch=branch, display_url=display_url)
2911
class ShelvedChanges(UncommittedChanges):
2913
_fmt = ('Working tree "%(display_url)s" has shelved changes'
2914
' (See bzr shelve --list).%(more)s')
2917
class MissingTemplateVariable(BzrError):
2919
_fmt = 'Variable {%(name)s} is not available.'
2921
def __init__(self, name):
2925
class NoTemplate(BzrError):
2927
_fmt = 'No template specified.'
2930
class UnableCreateSymlink(BzrError):
2932
_fmt = 'Unable to create symlink %(path_str)son this platform'
2934
def __init__(self, path=None):
2938
path_str = repr(str(path))
2939
except UnicodeEncodeError:
2940
path_str = repr(path)
2942
self.path_str = path_str
2945
class UnsupportedTimezoneFormat(BzrError):
2947
_fmt = ('Unsupported timezone format "%(timezone)s", '
2948
'options are "utc", "original", "local".')
2950
def __init__(self, timezone):
2951
self.timezone = timezone
2954
class CommandAvailableInPlugin(StandardError):
2956
internal_error = False
2958
def __init__(self, cmd_name, plugin_metadata, provider):
2960
self.plugin_metadata = plugin_metadata
2961
self.cmd_name = cmd_name
2962
self.provider = provider
2966
_fmt = ('"%s" is not a standard bzr command. \n'
2967
'However, the following official plugin provides this command: %s\n'
2968
'You can install it by going to: %s'
2969
% (self.cmd_name, self.plugin_metadata['name'],
2970
self.plugin_metadata['url']))
2975
class NoPluginAvailable(BzrError):
2979
class UnableEncodePath(BzrError):
2981
_fmt = ('Unable to encode %(kind)s path %(path)r in '
2982
'user encoding %(user_encoding)s')
2984
def __init__(self, path, kind):
2985
from bzrlib.osutils import get_user_encoding
2988
self.user_encoding = get_user_encoding()
2991
class NoSuchConfig(BzrError):
2993
_fmt = ('The "%(config_id)s" configuration does not exist.')
2995
def __init__(self, config_id):
2996
BzrError.__init__(self, config_id=config_id)
2999
class NoSuchConfigOption(BzrError):
3001
_fmt = ('The "%(option_name)s" configuration option does not exist.')
3003
def __init__(self, option_name):
3004
BzrError.__init__(self, option_name=option_name)
3007
class NoSuchAlias(BzrError):
3009
_fmt = ('The alias "%(alias_name)s" does not exist.')
3011
def __init__(self, alias_name):
3012
BzrError.__init__(self, alias_name=alias_name)
3015
class DirectoryLookupFailure(BzrError):
3016
"""Base type for lookup errors."""
3021
class InvalidLocationAlias(DirectoryLookupFailure):
3023
_fmt = '"%(alias_name)s" is not a valid location alias.'
3025
def __init__(self, alias_name):
3026
DirectoryLookupFailure.__init__(self, alias_name=alias_name)
3029
class UnsetLocationAlias(DirectoryLookupFailure):
3031
_fmt = 'No %(alias_name)s location assigned.'
3033
def __init__(self, alias_name):
3034
DirectoryLookupFailure.__init__(self, alias_name=alias_name[1:])
3037
class CannotBindAddress(BzrError):
3039
_fmt = 'Cannot bind address "%(host)s:%(port)i": %(orig_error)s.'
3041
def __init__(self, host, port, orig_error):
3042
# nb: in python2.4 socket.error doesn't have a useful repr
3043
BzrError.__init__(self, host=host, port=port,
3044
orig_error=repr(orig_error.args))
3047
class UnknownRules(BzrError):
3049
_fmt = ('Unknown rules detected: %(unknowns_str)s.')
3051
def __init__(self, unknowns):
3052
BzrError.__init__(self, unknowns_str=", ".join(unknowns))
3055
class TipChangeRejected(BzrError):
3056
"""A pre_change_branch_tip hook function may raise this to cleanly and
3057
explicitly abort a change to a branch tip.
3060
_fmt = u"Tip change rejected: %(msg)s"
3062
def __init__(self, msg):
3066
class ShelfCorrupt(BzrError):
3068
_fmt = "Shelf corrupt."
3071
class DecompressCorruption(BzrError):
3073
_fmt = "Corruption while decompressing repository file%(orig_error)s"
3075
def __init__(self, orig_error=None):
3076
if orig_error is not None:
3077
self.orig_error = ", %s" % (orig_error,)
3079
self.orig_error = ""
3080
BzrError.__init__(self)
3083
class NoSuchShelfId(BzrError):
3085
_fmt = 'No changes are shelved with id "%(shelf_id)d".'
3087
def __init__(self, shelf_id):
3088
BzrError.__init__(self, shelf_id=shelf_id)
3091
class InvalidShelfId(BzrError):
3093
_fmt = '"%(invalid_id)s" is not a valid shelf id, try a number instead.'
3095
def __init__(self, invalid_id):
3096
BzrError.__init__(self, invalid_id=invalid_id)
3099
class JailBreak(BzrError):
3101
_fmt = "An attempt to access a url outside the server jail was made: '%(url)s'."
3103
def __init__(self, url):
3104
BzrError.__init__(self, url=url)
3107
class UserAbort(BzrError):
3109
_fmt = 'The user aborted the operation.'
3112
class MustHaveWorkingTree(BzrError):
3114
_fmt = ("Branching '%(url)s'(%(format)s) must create a working tree.")
3116
def __init__(self, format, url):
3117
BzrError.__init__(self, format=format, url=url)
3120
class NoSuchView(BzrError):
3121
"""A view does not exist.
3124
_fmt = u"No such view: %(view_name)s."
3126
def __init__(self, view_name):
3127
self.view_name = view_name
3130
class ViewsNotSupported(BzrError):
3131
"""Views are not supported by a tree format.
3134
_fmt = ("Views are not supported by %(tree)s;"
3135
" use 'bzr upgrade' to change your tree to a later format.")
3137
def __init__(self, tree):
3141
class FileOutsideView(BzrError):
3143
_fmt = ('Specified file "%(file_name)s" is outside the current view: '
3146
def __init__(self, file_name, view_files):
3147
self.file_name = file_name
3148
self.view_str = ", ".join(view_files)
3151
class UnresumableWriteGroup(BzrError):
3153
_fmt = ("Repository %(repository)s cannot resume write group "
3154
"%(write_groups)r: %(reason)s")
3156
internal_error = True
3158
def __init__(self, repository, write_groups, reason):
3159
self.repository = repository
3160
self.write_groups = write_groups
3161
self.reason = reason
3164
class UnsuspendableWriteGroup(BzrError):
3166
_fmt = ("Repository %(repository)s cannot suspend a write group.")
3168
internal_error = True
3170
def __init__(self, repository):
3171
self.repository = repository
3174
class LossyPushToSameVCS(BzrError):
3176
_fmt = ("Lossy push not possible between %(source_branch)r and "
3177
"%(target_branch)r that are in the same VCS.")
3179
internal_error = True
3181
def __init__(self, source_branch, target_branch):
3182
self.source_branch = source_branch
3183
self.target_branch = target_branch
3186
class NoRoundtrippingSupport(BzrError):
3188
_fmt = ("Roundtripping is not supported between %(source_branch)r and "
3189
"%(target_branch)r.")
3191
internal_error = True
3193
def __init__(self, source_branch, target_branch):
3194
self.source_branch = source_branch
3195
self.target_branch = target_branch
3198
class FileTimestampUnavailable(BzrError):
3200
_fmt = "The filestamp for %(path)s is not available."
3202
internal_error = True
3204
def __init__(self, path):
3208
class NoColocatedBranchSupport(BzrError):
3210
_fmt = ("%(bzrdir)r does not support co-located branches.")
3212
def __init__(self, bzrdir):
3213
self.bzrdir = bzrdir
3216
class NoWhoami(BzrError):
3218
_fmt = ('Unable to determine your name.\n'
3219
"Please, set your name with the 'whoami' command.\n"
3220
'E.g. bzr whoami "Your Name <name@example.com>"')
3223
class InvalidPattern(BzrError):
3225
_fmt = ('Invalid pattern(s) found. %(msg)s')
3227
def __init__(self, msg):
3231
class RecursiveBind(BzrError):
3233
_fmt = ('Branch "%(branch_url)s" appears to be bound to itself. '
3234
'Please use `bzr unbind` to fix.')
3236
def __init__(self, branch_url):
3237
self.branch_url = branch_url
3240
# FIXME: I would prefer to define the config related exception classes in
3241
# config.py but the lazy import mechanism proscribes this -- vila 20101222
3242
class OptionExpansionLoop(BzrError):
3244
_fmt = 'Loop involving %(refs)r while expanding "%(string)s".'
3246
def __init__(self, string, refs):
3247
self.string = string
3248
self.refs = '->'.join(refs)
3251
class ExpandingUnknownOption(BzrError):
3253
_fmt = 'Option "%(name)s" is not defined while expanding "%(string)s".'
3255
def __init__(self, name, string):
3257
self.string = string
3260
class IllegalOptionName(BzrError):
3262
_fmt = 'Option "%(name)s" is not allowed.'
3264
def __init__(self, name):
3268
class NoCompatibleInter(BzrError):
3270
_fmt = ('No compatible object available for operations from %(source)r '
3273
def __init__(self, source, target):
3274
self.source = source
3275
self.target = target
3278
class HpssVfsRequestNotAllowed(BzrError):
3280
_fmt = ("VFS requests over the smart server are not allowed. Encountered: "
3281
"%(method)s, %(arguments)s.")
3283
def __init__(self, method, arguments):
3284
self.method = method
3285
self.arguments = arguments
3288
class UnsupportedKindChange(BzrError):
3290
_fmt = ("Kind change from %(from_kind)s to %(to_kind)s for "
3291
"%(path)s not supported by format %(format)r")
3293
def __init__(self, path, from_kind, to_kind, format):
3295
self.from_kind = from_kind
3296
self.to_kind = to_kind
3297
self.format = format
3300
class MissingFeature(BzrError):
3302
_fmt = ("Missing feature %(feature)s not provided by this "
3303
"version of Bazaar or any plugin.")
3305
def __init__(self, feature):
3306
self.feature = feature
3309
class PatchSyntax(BzrError):
3310
"""Base class for patch syntax errors."""
3313
class BinaryFiles(BzrError):
3315
_fmt = 'Binary files section encountered.'
3317
def __init__(self, orig_name, mod_name):
3318
self.orig_name = orig_name
3319
self.mod_name = mod_name
3322
class MalformedPatchHeader(PatchSyntax):
3324
_fmt = "Malformed patch header. %(desc)s\n%(line)r"
3326
def __init__(self, desc, line):
3331
class MalformedHunkHeader(PatchSyntax):
3333
_fmt = "Malformed hunk header. %(desc)s\n%(line)r"
3335
def __init__(self, desc, line):
3340
class MalformedLine(PatchSyntax):
3342
_fmt = "Malformed line. %(desc)s\n%(line)r"
3344
def __init__(self, desc, line):
3349
class PatchConflict(BzrError):
3351
_fmt = ('Text contents mismatch at line %(line_no)d. Original has '
3352
'"%(orig_line)s", but patch says it should be "%(patch_line)s"')
3354
def __init__(self, line_no, orig_line, patch_line):
3355
self.line_no = line_no
3356
self.orig_line = orig_line.rstrip('\n')
3357
self.patch_line = patch_line.rstrip('\n')
3360
class FeatureAlreadyRegistered(BzrError):
3362
_fmt = 'The feature %(feature)s has already been registered.'
3364
def __init__(self, feature):
3365
self.feature = feature
3368
class ChangesAlreadyStored(BzrCommandError):
3370
_fmt = ('Cannot store uncommitted changes because this branch already'
3371
' stores uncommitted changes.')