143
class NotLocalUrl(BzrNewError):
144
"""%s(url) is not a local path."""
146
def __init__(self, url):
147
BzrNewError.__init__(self)
143
151
class BzrCommandError(BzrError):
144
152
# Error from malformed user command
145
153
# This is being misused as a generic exception
214
class NoRepositoryPresent(BzrNewError):
215
"""Not repository present: %(path)r"""
216
def __init__(self, bzrdir):
217
BzrNewError.__init__(self)
218
self.path = bzrdir.transport.clone('..').base
206
221
class FileInWrongBranch(BzrNewError):
207
222
"""File %(path)s in not in branch %(branch_base)s."""
208
224
def __init__(self, branch, path):
209
225
BzrNewError.__init__(self)
210
226
self.branch = branch
215
231
class UnsupportedFormatError(BzrError):
216
"""Specified path is a bzr branch that we cannot read."""
232
"""Specified path is a bzr branch that we recognize but cannot read."""
217
233
def __str__(self):
218
234
return 'unsupported branch format: %s' % self.args[0]
237
class UnknownFormatError(BzrError):
238
"""Specified path is a bzr branch whose format we do not recognize."""
240
return 'unknown branch format: %s' % self.args[0]
243
class IncompatibleFormat(BzrNewError):
244
"""Format %(format)s is not compatible with .bzr version %(bzrdir)s."""
246
def __init__(self, format, bzrdir_format):
247
BzrNewError.__init__(self)
249
self.bzrdir = bzrdir_format
221
252
class NotVersionedError(BzrNewError):
222
253
"""%(path)s is not versioned"""
223
254
def __init__(self, path):
257
288
class PointlessCommit(BzrNewError):
258
289
"""No changes to commit"""
292
class UpgradeReadonly(BzrNewError):
293
"""Upgrade URL cannot work with readonly URL's."""
260
296
class StrictCommitFailed(Exception):
261
297
"""Commit refused because there are unknowns in the tree."""
263
300
class NoSuchRevision(BzrError):
264
301
def __init__(self, branch, revision):
265
302
self.branch = branch
376
413
"""Text did not match it's checksum: %(message)s"""
416
class WeaveTextDiffers(WeaveError):
417
"""Weaves differ on text content. Revision: {%(revision_id)s}, %(weave_a)s, %(weave_b)s"""
419
def __init__(self, revision_id, weave_a, weave_b):
420
WeaveError.__init__(self)
421
self.revision_id = revision_id
422
self.weave_a = weave_a
423
self.weave_b = weave_b
379
426
class NoSuchExportFormat(BzrNewError):
380
427
"""Export format %(format)r not supported"""
381
428
def __init__(self, format):
477
525
class BzrBadParameter(BzrNewError):
478
"""Parameter %(param)s is neither unicode nor utf8."""
526
"""A bad parameter : %(param)s is not usable.
528
This exception should never be thrown, but it is a base class for all
529
parameter-to-function errors.
480
531
def __init__(self, param):
481
532
BzrNewError.__init__(self)
482
533
self.param = param
536
class BzrBadParameterNotUnicode(BzrBadParameter):
537
"""Parameter %(param)s is neither unicode nor utf8."""
540
class BzrBadParameterNotString(BzrBadParameter):
541
"""Parameter %(param)s is not a string or unicode string."""
544
class BzrBadParameterMissing(BzrBadParameter):
545
"""Parameter $(param)s is required but not present."""
548
class DependencyNotPresent(BzrNewError):
549
"""Unable to import library: %(library)s, %(error)s"""
551
def __init__(self, library, error):
552
BzrNewError.__init__(self, library=library, error=error)
555
class ParamikoNotPresent(DependencyNotPresent):
556
"""Unable to import paramiko (required for sftp support): %(error)s"""
558
def __init__(self, error):
559
DependencyNotPresent.__init__(self, 'paramiko', error)
562
class UninitializableFormat(BzrNewError):
563
"""Format %(format)s cannot be initialised by this version of bzr."""
565
def __init__(self, format):
566
BzrNewError.__init__(self)