335
732
class InaccessibleParent(PathError):
336
"""Parent not accessible given base %(base)s and relative path %(path)s"""
734
_fmt = ('Parent not accessible given base "%(base)s" and'
735
' relative path "%(path)s"')
338
737
def __init__(self, path, base):
339
738
PathError.__init__(self, path)
343
class NoRepositoryPresent(BzrNewError):
344
"""No repository present: %(path)r"""
742
class NoRepositoryPresent(BzrError):
744
_fmt = 'No repository present: "%(path)s"'
345
745
def __init__(self, bzrdir):
346
BzrNewError.__init__(self)
746
BzrError.__init__(self)
347
747
self.path = bzrdir.transport.clone('..').base
350
class FileInWrongBranch(BzrNewError):
351
"""File %(path)s in not in branch %(branch_base)s."""
750
class FileInWrongBranch(BzrError):
752
_fmt = 'File "%(path)s" is not in branch %(branch_base)s.'
353
754
def __init__(self, branch, path):
354
BzrNewError.__init__(self)
755
BzrError.__init__(self)
355
756
self.branch = branch
356
757
self.branch_base = branch.base
360
class UnsupportedFormatError(BzrNewError):
361
"""Unsupported branch format: %(format)s"""
364
class UnknownFormatError(BzrNewError):
365
"""Unknown branch format: %(format)r"""
368
class IncompatibleFormat(BzrNewError):
369
"""Format %(format)s is not compatible with .bzr version %(bzrdir)s."""
761
class UnsupportedFormatError(BzrError):
763
_fmt = "Unsupported branch format: %(format)s\nPlease run 'bzr upgrade'"
766
class UnknownFormatError(BzrError):
768
_fmt = "Unknown %(kind)s format: %(format)r"
770
def __init__(self, format, kind='branch'):
775
class IncompatibleFormat(BzrError):
777
_fmt = "Format %(format)s is not compatible with .bzr version %(bzrdir)s."
371
779
def __init__(self, format, bzrdir_format):
372
BzrNewError.__init__(self)
780
BzrError.__init__(self)
373
781
self.format = format
374
782
self.bzrdir = bzrdir_format
377
class NotVersionedError(BzrNewError):
378
"""%(path)s is not versioned"""
379
def __init__(self, path):
380
BzrNewError.__init__(self)
384
class PathsNotVersionedError(BzrNewError):
385
# used when reporting several paths are not versioned
386
"""Path(s) are not versioned: %(paths_as_string)s"""
785
class IncompatibleRepositories(BzrError):
787
_fmt = "%(target)s\n" \
788
"is not compatible with\n" \
792
def __init__(self, source, target, details=None):
794
details = "(no details)"
795
BzrError.__init__(self, target=target, source=source, details=details)
798
class IncompatibleRevision(BzrError):
800
_fmt = "Revision is not compatible with %(repo_format)s"
802
def __init__(self, repo_format):
803
BzrError.__init__(self)
804
self.repo_format = repo_format
807
class AlreadyVersionedError(BzrError):
808
"""Used when a path is expected not to be versioned, but it is."""
810
_fmt = "%(context_info)s%(path)s is already versioned."
812
def __init__(self, path, context_info=None):
813
"""Construct a new AlreadyVersionedError.
815
:param path: This is the path which is versioned,
816
which should be in a user friendly form.
817
:param context_info: If given, this is information about the context,
818
which could explain why this is expected to not be versioned.
820
BzrError.__init__(self)
822
if context_info is None:
823
self.context_info = ''
825
self.context_info = context_info + ". "
828
class NotVersionedError(BzrError):
829
"""Used when a path is expected to be versioned, but it is not."""
831
_fmt = "%(context_info)s%(path)s is not versioned."
833
def __init__(self, path, context_info=None):
834
"""Construct a new NotVersionedError.
836
:param path: This is the path which is not versioned,
837
which should be in a user friendly form.
838
:param context_info: If given, this is information about the context,
839
which could explain why this is expected to be versioned.
841
BzrError.__init__(self)
843
if context_info is None:
844
self.context_info = ''
846
self.context_info = context_info + ". "
849
class PathsNotVersionedError(BzrError):
850
"""Used when reporting several paths which are not versioned"""
852
_fmt = "Path(s) are not versioned: %(paths_as_string)s"
388
854
def __init__(self, paths):
389
855
from bzrlib.osutils import quotefn
390
BzrNewError.__init__(self)
856
BzrError.__init__(self)
391
857
self.paths = paths
392
858
self.paths_as_string = ' '.join([quotefn(p) for p in paths])
395
class PathsDoNotExist(BzrNewError):
396
"""Path(s) do not exist: %(paths_as_string)s"""
861
class PathsDoNotExist(BzrError):
863
_fmt = "Path(s) do not exist: %(paths_as_string)s%(extra)s"
398
865
# used when reporting that paths are neither versioned nor in the working
401
def __init__(self, paths):
868
def __init__(self, paths, extra=None):
402
869
# circular import
403
870
from bzrlib.osutils import quotefn
404
BzrNewError.__init__(self)
871
BzrError.__init__(self)
405
872
self.paths = paths
406
873
self.paths_as_string = ' '.join([quotefn(p) for p in paths])
409
class BadFileKindError(BzrNewError):
410
"""Cannot operate on %(filename)s of unsupported kind %(kind)s"""
413
class ForbiddenControlFileError(BzrNewError):
414
"""Cannot operate on %(filename)s because it is a control file"""
417
class LockError(BzrNewError):
418
"""Lock error: %(message)s"""
875
self.extra = ': ' + str(extra)
880
class BadFileKindError(BzrError):
882
_fmt = 'Cannot operate on "%(filename)s" of unsupported kind "%(kind)s"'
884
def __init__(self, filename, kind):
885
BzrError.__init__(self, filename=filename, kind=kind)
888
class BadFilenameEncoding(BzrError):
890
_fmt = ('Filename %(filename)r is not valid in your current filesystem'
891
' encoding %(fs_encoding)s')
893
def __init__(self, filename, fs_encoding):
894
BzrError.__init__(self)
895
self.filename = filename
896
self.fs_encoding = fs_encoding
899
class ForbiddenControlFileError(BzrError):
901
_fmt = 'Cannot operate on "%(filename)s" because it is a control file'
904
class LockError(InternalBzrError):
906
_fmt = "Lock error: %(msg)s"
419
908
# All exceptions from the lock/unlock functions should be from
420
909
# this exception class. They will be translated as necessary. The
421
910
# original exception is available as e.original_error
423
912
# New code should prefer to raise specific subclasses
424
913
def __init__(self, message):
425
self.message = message
914
# Python 2.5 uses a slot for StandardError.message,
915
# so use a different variable name. We now work around this in
916
# BzrError.__str__, but this member name is kept for compatability.
920
class LockActive(LockError):
922
_fmt = "The lock for '%(lock_description)s' is in use and cannot be broken."
924
internal_error = False
926
def __init__(self, lock_description):
927
self.lock_description = lock_description
428
930
class CommitNotPossible(LockError):
429
"""A commit was attempted but we do not have a write lock open."""
932
_fmt = "A commit was attempted but we do not have a write lock open."
430
934
def __init__(self):
434
938
class AlreadyCommitted(LockError):
435
"""A rollback was requested, but is not able to be accomplished."""
940
_fmt = "A rollback was requested, but is not able to be accomplished."
436
942
def __init__(self):
440
946
class ReadOnlyError(LockError):
441
"""A write attempt was made in a read only transaction on %(obj)s"""
948
_fmt = "A write attempt was made in a read only transaction on %(obj)s"
950
# TODO: There should also be an error indicating that you need a write
951
# lock and don't have any lock at all... mbp 20070226
442
953
def __init__(self, obj):
446
class OutSideTransaction(BzrNewError):
447
"""A transaction related operation was attempted after the transaction finished."""
957
class LockFailed(LockError):
959
internal_error = False
961
_fmt = "Cannot lock %(lock)s: %(why)s"
963
def __init__(self, lock, why):
964
LockError.__init__(self, '')
969
class OutSideTransaction(BzrError):
971
_fmt = ("A transaction related operation was attempted after"
972
" the transaction finished.")
450
975
class ObjectNotLocked(LockError):
451
"""%(obj)r is not locked"""
453
is_user_error = False
977
_fmt = "%(obj)r is not locked"
455
979
# this can indicate that any particular object is not locked; see also
456
980
# LockNotHeld which means that a particular *lock* object is not held by
824
1656
class InvalidHttpRange(InvalidHttpResponse):
825
"""Invalid http range "%(range)s" for %(path)s: %(msg)s"""
1658
_fmt = "Invalid http range %(range)r for %(path)s: %(msg)s"
827
1660
def __init__(self, path, range, msg):
828
1661
self.range = range
829
1662
InvalidHttpResponse.__init__(self, path, msg)
832
1665
class InvalidHttpContentType(InvalidHttpResponse):
833
"""Invalid http Content-type "%(ctype)s" for %(path)s: %(msg)s"""
1667
_fmt = 'Invalid http Content-type "%(ctype)s" for %(path)s: %(msg)s'
835
1669
def __init__(self, path, ctype, msg):
836
1670
self.ctype = ctype
837
1671
InvalidHttpResponse.__init__(self, path, msg)
1674
class RedirectRequested(TransportError):
1676
_fmt = '%(source)s is%(permanently)s redirected to %(target)s'
1678
def __init__(self, source, target, is_permanent=False):
1679
self.source = source
1680
self.target = target
1682
self.permanently = ' permanently'
1684
self.permanently = ''
1685
TransportError.__init__(self)
1688
class TooManyRedirections(TransportError):
1690
_fmt = "Too many redirections"
840
1693
class ConflictsInTree(BzrError):
842
BzrError.__init__(self, "Working tree has conflicts.")
1695
_fmt = "Working tree has conflicts."
845
1698
class ParseConfigError(BzrError):
846
1700
def __init__(self, errors, filename):
847
1701
if filename is None:
849
1703
message = "Error(s) parsing config file %s:\n%s" % \
850
(filename, ('\n'.join(e.message for e in errors)))
1704
(filename, ('\n'.join(e.msg for e in errors)))
851
1705
BzrError.__init__(self, message)
1708
class NoEmailInUsername(BzrError):
1710
_fmt = "%(username)r does not seem to contain a reasonable email address"
1712
def __init__(self, username):
1713
BzrError.__init__(self)
1714
self.username = username
854
1717
class SigningFailed(BzrError):
1719
_fmt = 'Failed to gpg sign data with command "%(command_line)s"'
855
1721
def __init__(self, command_line):
856
BzrError.__init__(self, "Failed to gpg sign data with command '%s'"
1722
BzrError.__init__(self, command_line=command_line)
860
1725
class WorkingTreeNotRevision(BzrError):
1727
_fmt = ("The working tree for %(basedir)s has changed since"
1728
" the last commit, but weave merge requires that it be"
861
1731
def __init__(self, tree):
862
BzrError.__init__(self, "The working tree for %s has changed since"
863
" last commit, but weave merge requires that it be"
864
" unchanged." % tree.basedir)
867
class CantReprocessAndShowBase(BzrNewError):
868
"""Can't reprocess and show base.
869
Reprocessing obscures relationship of conflicting lines to base."""
872
class GraphCycleError(BzrNewError):
873
"""Cycle in graph %(graph)r"""
1732
BzrError.__init__(self, basedir=tree.basedir)
1735
class CantReprocessAndShowBase(BzrError):
1737
_fmt = ("Can't reprocess and show base, because reprocessing obscures "
1738
"the relationship of conflicting lines to the base")
1741
class GraphCycleError(BzrError):
1743
_fmt = "Cycle in graph %(graph)r"
874
1745
def __init__(self, graph):
875
BzrNewError.__init__(self)
1746
BzrError.__init__(self)
876
1747
self.graph = graph
879
class NotConflicted(BzrNewError):
880
"""File %(filename)s is not conflicted."""
1750
class WritingCompleted(InternalBzrError):
1752
_fmt = ("The MediumRequest '%(request)s' has already had finish_writing "
1753
"called upon it - accept bytes may not be called anymore.")
1755
def __init__(self, request):
1756
self.request = request
1759
class WritingNotComplete(InternalBzrError):
1761
_fmt = ("The MediumRequest '%(request)s' has not has finish_writing "
1762
"called upon it - until the write phase is complete no "
1763
"data may be read.")
1765
def __init__(self, request):
1766
self.request = request
1769
class NotConflicted(BzrError):
1771
_fmt = "File %(filename)s is not conflicted."
882
1773
def __init__(self, filename):
883
BzrNewError.__init__(self)
1774
BzrError.__init__(self)
884
1775
self.filename = filename
1778
class MediumNotConnected(InternalBzrError):
1780
_fmt = """The medium '%(medium)s' is not connected."""
1782
def __init__(self, medium):
1783
self.medium = medium
887
1786
class MustUseDecorated(Exception):
888
"""A decorating function has requested its original command be used.
890
This should never escape bzr, so does not need to be printable.
894
class NoBundleFound(BzrNewError):
895
"""No bundle was found in %(filename)s"""
1788
_fmt = "A decorating function has requested its original command be used."
1791
class NoBundleFound(BzrError):
1793
_fmt = 'No bundle was found in "%(filename)s".'
896
1795
def __init__(self, filename):
897
BzrNewError.__init__(self)
1796
BzrError.__init__(self)
898
1797
self.filename = filename
901
class BundleNotSupported(BzrNewError):
902
"""Unable to handle bundle version %(version)s: %(msg)s"""
1800
class BundleNotSupported(BzrError):
1802
_fmt = "Unable to handle bundle version %(version)s: %(msg)s"
903
1804
def __init__(self, version, msg):
904
BzrNewError.__init__(self)
1805
BzrError.__init__(self)
905
1806
self.version = version
909
class MissingText(BzrNewError):
910
"""Branch %(base)s is missing revision %(text_revision)s of %(file_id)s"""
1810
class MissingText(BzrError):
1812
_fmt = ("Branch %(base)s is missing revision"
1813
" %(text_revision)s of %(file_id)s")
912
1815
def __init__(self, branch, text_revision, file_id):
913
BzrNewError.__init__(self)
1816
BzrError.__init__(self)
914
1817
self.branch = branch
915
1818
self.base = branch.base
916
1819
self.text_revision = text_revision
917
1820
self.file_id = file_id
920
class DuplicateKey(BzrNewError):
921
"""Key %(key)s is already present in map"""
924
class MalformedTransform(BzrNewError):
925
"""Tree transform is malformed %(conflicts)r"""
928
class BzrBadParameter(BzrNewError):
929
"""A bad parameter : %(param)s is not usable.
931
This exception should never be thrown, but it is a base class for all
932
parameter-to-function errors.
1823
class DuplicateFileId(BzrError):
1825
_fmt = "File id {%(file_id)s} already exists in inventory as %(entry)s"
1827
def __init__(self, file_id, entry):
1828
BzrError.__init__(self)
1829
self.file_id = file_id
1833
class DuplicateKey(BzrError):
1835
_fmt = "Key %(key)s is already present in map"
1838
class DuplicateHelpPrefix(BzrError):
1840
_fmt = "The prefix %(prefix)s is in the help search path twice."
1842
def __init__(self, prefix):
1843
self.prefix = prefix
1846
class MalformedTransform(BzrError):
1848
_fmt = "Tree transform is malformed %(conflicts)r"
1851
class NoFinalPath(BzrError):
1853
_fmt = ("No final name for trans_id %(trans_id)r\n"
1854
"file-id: %(file_id)r\n"
1855
"root trans-id: %(root_trans_id)r\n")
1857
def __init__(self, trans_id, transform):
1858
self.trans_id = trans_id
1859
self.file_id = transform.final_file_id(trans_id)
1860
self.root_trans_id = transform.root
1863
class BzrBadParameter(InternalBzrError):
1865
_fmt = "Bad parameter: %(param)r"
1867
# This exception should never be thrown, but it is a base class for all
1868
# parameter-to-function errors.
934
1870
def __init__(self, param):
935
BzrNewError.__init__(self)
1871
BzrError.__init__(self)
936
1872
self.param = param
939
1875
class BzrBadParameterNotUnicode(BzrBadParameter):
940
"""Parameter %(param)s is neither unicode nor utf8."""
943
class ReusingTransform(BzrNewError):
944
"""Attempt to reuse a transform that has already been applied."""
947
class CantMoveRoot(BzrNewError):
948
"""Moving the root directory is not supported at this time"""
1877
_fmt = "Parameter %(param)s is neither unicode nor utf8."
1880
class ReusingTransform(BzrError):
1882
_fmt = "Attempt to reuse a transform that has already been applied."
1885
class CantMoveRoot(BzrError):
1887
_fmt = "Moving the root directory is not supported at this time"
1890
class BzrMoveFailedError(BzrError):
1892
_fmt = "Could not move %(from_path)s%(operator)s %(to_path)s%(extra)s"
1894
def __init__(self, from_path='', to_path='', extra=None):
1895
from bzrlib.osutils import splitpath
1896
BzrError.__init__(self)
1898
self.extra = ': ' + str(extra)
1902
has_from = len(from_path) > 0
1903
has_to = len(to_path) > 0
1905
self.from_path = splitpath(from_path)[-1]
1910
self.to_path = splitpath(to_path)[-1]
1915
if has_from and has_to:
1916
self.operator = " =>"
1918
self.from_path = "from " + from_path
1920
self.operator = "to"
1922
self.operator = "file"
1925
class BzrRenameFailedError(BzrMoveFailedError):
1927
_fmt = "Could not rename %(from_path)s%(operator)s %(to_path)s%(extra)s"
1929
def __init__(self, from_path, to_path, extra=None):
1930
BzrMoveFailedError.__init__(self, from_path, to_path, extra)
1932
class BzrRemoveChangedFilesError(BzrError):
1933
"""Used when user is trying to remove changed files."""
1935
_fmt = ("Can't safely remove modified or unknown files:\n"
1936
"%(changes_as_text)s"
1937
"Use --keep to not delete them, or --force to delete them regardless.")
1939
def __init__(self, tree_delta):
1940
BzrError.__init__(self)
1941
self.changes_as_text = tree_delta.get_changes_as_text()
1942
#self.paths_as_string = '\n'.join(changed_files)
1943
#self.paths_as_string = '\n'.join([quotefn(p) for p in changed_files])
951
1946
class BzrBadParameterNotString(BzrBadParameter):
952
"""Parameter %(param)s is not a string or unicode string."""
1948
_fmt = "Parameter %(param)s is not a string or unicode string."
955
1951
class BzrBadParameterMissing(BzrBadParameter):
956
"""Parameter $(param)s is required but not present."""
1953
_fmt = "Parameter $(param)s is required but not present."
959
1956
class BzrBadParameterUnicode(BzrBadParameter):
960
"""Parameter %(param)s is unicode but only byte-strings are permitted."""
1958
_fmt = ("Parameter %(param)s is unicode but"
1959
" only byte-strings are permitted.")
963
1962
class BzrBadParameterContainsNewline(BzrBadParameter):
964
"""Parameter %(param)s contains a newline."""
967
class DependencyNotPresent(BzrNewError):
968
"""Unable to import library "%(library)s": %(error)s"""
1964
_fmt = "Parameter %(param)s contains a newline."
1967
class DependencyNotPresent(BzrError):
1969
_fmt = 'Unable to import library "%(library)s": %(error)s'
970
1971
def __init__(self, library, error):
971
BzrNewError.__init__(self, library=library, error=error)
1972
BzrError.__init__(self, library=library, error=error)
974
1975
class ParamikoNotPresent(DependencyNotPresent):
975
"""Unable to import paramiko (required for sftp support): %(error)s"""
1977
_fmt = "Unable to import paramiko (required for sftp support): %(error)s"
977
1979
def __init__(self, error):
978
1980
DependencyNotPresent.__init__(self, 'paramiko', error)
981
class PointlessMerge(BzrNewError):
982
"""Nothing to merge."""
985
class UninitializableFormat(BzrNewError):
986
"""Format %(format)s cannot be initialised by this version of bzr."""
1983
class PointlessMerge(BzrError):
1985
_fmt = "Nothing to merge."
1988
class UninitializableFormat(BzrError):
1990
_fmt = "Format %(format)s cannot be initialised by this version of bzr."
988
1992
def __init__(self, format):
989
BzrNewError.__init__(self)
1993
BzrError.__init__(self)
990
1994
self.format = format
993
class BadConversionTarget(BzrNewError):
994
"""Cannot convert to format %(format)s. %(problem)s"""
1997
class BadConversionTarget(BzrError):
1999
_fmt = "Cannot convert to format %(format)s. %(problem)s"
996
2001
def __init__(self, problem, format):
997
BzrNewError.__init__(self)
2002
BzrError.__init__(self)
998
2003
self.problem = problem
999
2004
self.format = format
1002
class NoDiff(BzrNewError):
1003
"""Diff is not installed on this machine: %(msg)s"""
2007
class NoDiffFound(BzrError):
2009
_fmt = 'Could not find an appropriate Differ for file "%(path)s"'
2011
def __init__(self, path):
2012
BzrError.__init__(self, path)
2015
class ExecutableMissing(BzrError):
2017
_fmt = "%(exe_name)s could not be found on this machine"
2019
def __init__(self, exe_name):
2020
BzrError.__init__(self, exe_name=exe_name)
2023
class NoDiff(BzrError):
2025
_fmt = "Diff is not installed on this machine: %(msg)s"
1005
2027
def __init__(self, msg):
1006
BzrNewError.__init__(self, msg=msg)
1009
class NoDiff3(BzrNewError):
1010
"""Diff3 is not installed on this machine."""
1013
class ExistingLimbo(BzrNewError):
1014
"""This tree contains left-over files from a failed operation.
1015
Please examine %(limbo_dir)s to see if it contains any files you wish to
1016
keep, and delete it when you are done.
1018
def __init__(self, limbo_dir):
1019
BzrNewError.__init__(self)
1020
self.limbo_dir = limbo_dir
1023
class ImmortalLimbo(BzrNewError):
1024
"""Unable to delete transform temporary directory $(limbo_dir)s.
1025
Please examine %(limbo_dir)s to see if it contains any files you wish to
1026
keep, and delete it when you are done.
1028
def __init__(self, limbo_dir):
1029
BzrNewError.__init__(self)
1030
self.limbo_dir = limbo_dir
1033
class OutOfDateTree(BzrNewError):
1034
"""Working tree is out of date, please run 'bzr update'."""
2028
BzrError.__init__(self, msg=msg)
2031
class NoDiff3(BzrError):
2033
_fmt = "Diff3 is not installed on this machine."
2036
class ExistingContent(BzrError):
2037
# Added in bzrlib 0.92, used by VersionedFile.add_lines.
2039
_fmt = "The content being inserted is already present."
2042
class ExistingLimbo(BzrError):
2044
_fmt = """This tree contains left-over files from a failed operation.
2045
Please examine %(limbo_dir)s to see if it contains any files you wish to
2046
keep, and delete it when you are done."""
2048
def __init__(self, limbo_dir):
2049
BzrError.__init__(self)
2050
self.limbo_dir = limbo_dir
2053
class ExistingPendingDeletion(BzrError):
2055
_fmt = """This tree contains left-over files from a failed operation.
2056
Please examine %(pending_deletion)s to see if it contains any files you
2057
wish to keep, and delete it when you are done."""
2059
def __init__(self, pending_deletion):
2060
BzrError.__init__(self, pending_deletion=pending_deletion)
2063
class ImmortalLimbo(BzrError):
2065
_fmt = """Unable to delete transform temporary directory %(limbo_dir)s.
2066
Please examine %(limbo_dir)s to see if it contains any files you wish to
2067
keep, and delete it when you are done."""
2069
def __init__(self, limbo_dir):
2070
BzrError.__init__(self)
2071
self.limbo_dir = limbo_dir
2074
class ImmortalPendingDeletion(BzrError):
2076
_fmt = ("Unable to delete transform temporary directory "
2077
"%(pending_deletion)s. Please examine %(pending_deletion)s to see if it "
2078
"contains any files you wish to keep, and delete it when you are done.")
2080
def __init__(self, pending_deletion):
2081
BzrError.__init__(self, pending_deletion=pending_deletion)
2084
class OutOfDateTree(BzrError):
2086
_fmt = "Working tree is out of date, please run 'bzr update'."
1036
2088
def __init__(self, tree):
1037
BzrNewError.__init__(self)
2089
BzrError.__init__(self)
1038
2090
self.tree = tree
1041
class MergeModifiedFormatError(BzrNewError):
1042
"""Error in merge modified format"""
1045
class ConflictFormatError(BzrNewError):
1046
"""Format error in conflict listings"""
1049
class CorruptRepository(BzrNewError):
1050
"""An error has been detected in the repository %(repo_path)s.
1051
Please run bzr reconcile on this repository."""
2093
class PublicBranchOutOfDate(BzrError):
2095
_fmt = 'Public branch "%(public_location)s" lacks revision '\
2098
def __init__(self, public_location, revstring):
2099
import bzrlib.urlutils as urlutils
2100
public_location = urlutils.unescape_for_display(public_location,
2102
BzrError.__init__(self, public_location=public_location,
2103
revstring=revstring)
2106
class MergeModifiedFormatError(BzrError):
2108
_fmt = "Error in merge modified format"
2111
class ConflictFormatError(BzrError):
2113
_fmt = "Format error in conflict listings"
2116
class CorruptDirstate(BzrError):
2118
_fmt = ("Inconsistency in dirstate file %(dirstate_path)s.\n"
2119
"Error: %(description)s")
2121
def __init__(self, dirstate_path, description):
2122
BzrError.__init__(self)
2123
self.dirstate_path = dirstate_path
2124
self.description = description
2127
class CorruptRepository(BzrError):
2129
_fmt = ("An error has been detected in the repository %(repo_path)s.\n"
2130
"Please run bzr reconcile on this repository.")
1053
2132
def __init__(self, repo):
1054
BzrNewError.__init__(self)
2133
BzrError.__init__(self)
1055
2134
self.repo_path = repo.bzrdir.root_transport.base
1058
class UpgradeRequired(BzrNewError):
1059
"""To use this feature you must upgrade your branch at %(path)s."""
2137
class InconsistentDelta(BzrError):
2138
"""Used when we get a delta that is not valid."""
2140
_fmt = ("An inconsistent delta was supplied involving %(path)r,"
2141
" %(file_id)r\nreason: %(reason)s")
2143
def __init__(self, path, file_id, reason):
2144
BzrError.__init__(self)
2146
self.file_id = file_id
2147
self.reason = reason
2150
class UpgradeRequired(BzrError):
2152
_fmt = "To use this feature you must upgrade your branch at %(path)s."
1061
2154
def __init__(self, path):
1062
BzrNewError.__init__(self)
2155
BzrError.__init__(self)
1063
2156
self.path = path
1066
class LocalRequiresBoundBranch(BzrNewError):
1067
"""Cannot perform local-only commits on unbound branches."""
1070
class MissingProgressBarFinish(BzrNewError):
1071
"""A nested progress bar was not 'finished' correctly."""
1074
class InvalidProgressBarType(BzrNewError):
1075
"""Environment variable BZR_PROGRESS_BAR='%(bar_type)s is not a supported type
1076
Select one of: %(valid_types)s"""
2159
class RepositoryUpgradeRequired(UpgradeRequired):
2161
_fmt = "To use this feature you must upgrade your repository at %(path)s."
2164
class LocalRequiresBoundBranch(BzrError):
2166
_fmt = "Cannot perform local-only commits on unbound branches."
2169
class InvalidProgressBarType(BzrError):
2171
_fmt = ("Environment variable BZR_PROGRESS_BAR='%(bar_type)s"
2172
" is not a supported type Select one of: %(valid_types)s")
1078
2174
def __init__(self, bar_type, valid_types):
1079
BzrNewError.__init__(self, bar_type=bar_type, valid_types=valid_types)
1082
class UnsupportedOperation(BzrNewError):
1083
"""The method %(mname)s is not supported on objects of type %(tname)s."""
2175
BzrError.__init__(self, bar_type=bar_type, valid_types=valid_types)
2178
class UnsupportedOperation(BzrError):
2180
_fmt = ("The method %(mname)s is not supported on"
2181
" objects of type %(tname)s.")
1084
2183
def __init__(self, method, method_self):
1085
2184
self.method = method
1086
2185
self.mname = method.__name__
1087
2186
self.tname = type(method_self).__name__
1090
class BinaryFile(BzrNewError):
1091
"""File is binary but should be text."""
1094
class IllegalPath(BzrNewError):
1095
"""The path %(path)s is not permitted on this platform"""
2189
class CannotSetRevisionId(UnsupportedOperation):
2190
"""Raised when a commit is attempting to set a revision id but cant."""
2193
class NonAsciiRevisionId(UnsupportedOperation):
2194
"""Raised when a commit is attempting to set a non-ascii revision id
2199
class BinaryFile(BzrError):
2201
_fmt = "File is binary but should be text."
2204
class IllegalPath(BzrError):
2206
_fmt = "The path %(path)s is not permitted on this platform"
1097
2208
def __init__(self, path):
1098
BzrNewError.__init__(self)
2209
BzrError.__init__(self)
1099
2210
self.path = path
1102
class TestamentMismatch(BzrNewError):
1103
"""Testament did not match expected value.
1104
For revision_id {%(revision_id)s}, expected {%(expected)s}, measured
2213
class TestamentMismatch(BzrError):
2215
_fmt = """Testament did not match expected value.
2216
For revision_id {%(revision_id)s}, expected {%(expected)s}, measured
1107
2219
def __init__(self, revision_id, expected, measured):
1108
2220
self.revision_id = revision_id
1109
2221
self.expected = expected
1110
2222
self.measured = measured
1113
class NotABundle(BzrNewError):
1114
"""Not a bzr revision-bundle: %(text)r"""
1116
def __init__(self, text):
1117
BzrNewError.__init__(self)
1121
class BadBundle(BzrNewError):
1122
"""Bad bzr revision-bundle: %(text)r"""
1124
def __init__(self, text):
1125
BzrNewError.__init__(self)
1129
class MalformedHeader(BadBundle):
1130
"""Malformed bzr revision-bundle header: %(text)r"""
1132
def __init__(self, text):
1133
BzrNewError.__init__(self)
1137
class MalformedPatches(BadBundle):
1138
"""Malformed patches in bzr revision-bundle: %(text)r"""
1140
def __init__(self, text):
1141
BzrNewError.__init__(self)
1145
class MalformedFooter(BadBundle):
1146
"""Malformed footer in bzr revision-bundle: %(text)r"""
1148
def __init__(self, text):
1149
BzrNewError.__init__(self)
2225
class NotABundle(BzrError):
2227
_fmt = "Not a bzr revision-bundle: %(text)r"
2229
def __init__(self, text):
2230
BzrError.__init__(self)
2234
class BadBundle(BzrError):
2236
_fmt = "Bad bzr revision-bundle: %(text)r"
2238
def __init__(self, text):
2239
BzrError.__init__(self)
2243
class MalformedHeader(BadBundle):
2245
_fmt = "Malformed bzr revision-bundle header: %(text)r"
2248
class MalformedPatches(BadBundle):
2250
_fmt = "Malformed patches in bzr revision-bundle: %(text)r"
2253
class MalformedFooter(BadBundle):
2255
_fmt = "Malformed footer in bzr revision-bundle: %(text)r"
1153
2258
class UnsupportedEOLMarker(BadBundle):
1154
"""End of line marker was not \\n in bzr revision-bundle"""
2260
_fmt = "End of line marker was not \\n in bzr revision-bundle"
1156
2262
def __init__(self):
1157
BzrNewError.__init__(self)
1160
class BadInventoryFormat(BzrNewError):
1161
"""Root class for inventory serialization errors"""
2263
# XXX: BadBundle's constructor assumes there's explanatory text,
2264
# but for this there is not
2265
BzrError.__init__(self)
2268
class IncompatibleBundleFormat(BzrError):
2270
_fmt = "Bundle format %(bundle_format)s is incompatible with %(other)s"
2272
def __init__(self, bundle_format, other):
2273
BzrError.__init__(self)
2274
self.bundle_format = bundle_format
2278
class BadInventoryFormat(BzrError):
2280
_fmt = "Root class for inventory serialization errors"
1164
2283
class UnexpectedInventoryFormat(BadInventoryFormat):
1165
"""The inventory was not in the expected format:\n %(msg)s"""
2285
_fmt = "The inventory was not in the expected format:\n %(msg)s"
1167
2287
def __init__(self, msg):
1168
2288
BadInventoryFormat.__init__(self, msg=msg)
1171
class UnknownSSH(BzrNewError):
1172
"""Unrecognised value for BZR_SSH environment variable: %(vendor)s"""
2291
class RootNotRich(BzrError):
2293
_fmt = """This operation requires rich root data storage"""
2296
class NoSmartMedium(InternalBzrError):
2298
_fmt = "The transport '%(transport)s' cannot tunnel the smart protocol."
2300
def __init__(self, transport):
2301
self.transport = transport
2304
class UnknownSSH(BzrError):
2306
_fmt = "Unrecognised value for BZR_SSH environment variable: %(vendor)s"
1174
2308
def __init__(self, vendor):
1175
BzrNewError.__init__(self)
2309
BzrError.__init__(self)
1176
2310
self.vendor = vendor
1179
class GhostRevisionUnusableHere(BzrNewError):
1180
"""Ghost revision {%(revision_id)s} cannot be used here."""
2313
class SSHVendorNotFound(BzrError):
2315
_fmt = ("Don't know how to handle SSH connections."
2316
" Please set BZR_SSH environment variable.")
2319
class GhostRevisionsHaveNoRevno(BzrError):
2320
"""When searching for revnos, if we encounter a ghost, we are stuck"""
2322
_fmt = ("Could not determine revno for {%(revision_id)s} because"
2323
" its ancestry shows a ghost at {%(ghost_revision_id)s}")
2325
def __init__(self, revision_id, ghost_revision_id):
2326
self.revision_id = revision_id
2327
self.ghost_revision_id = ghost_revision_id
2330
class GhostRevisionUnusableHere(BzrError):
2332
_fmt = "Ghost revision {%(revision_id)s} cannot be used here."
1182
2334
def __init__(self, revision_id):
1183
BzrNewError.__init__(self)
2335
BzrError.__init__(self)
1184
2336
self.revision_id = revision_id
2339
class IllegalUseOfScopeReplacer(InternalBzrError):
2341
_fmt = ("ScopeReplacer object %(name)r was used incorrectly:"
2342
" %(msg)s%(extra)s")
2344
def __init__(self, name, msg, extra=None):
2345
BzrError.__init__(self)
2349
self.extra = ': ' + str(extra)
2354
class InvalidImportLine(InternalBzrError):
2356
_fmt = "Not a valid import statement: %(msg)\n%(text)s"
2358
def __init__(self, text, msg):
2359
BzrError.__init__(self)
2364
class ImportNameCollision(InternalBzrError):
2366
_fmt = ("Tried to import an object to the same name as"
2367
" an existing object. %(name)s")
2369
def __init__(self, name):
2370
BzrError.__init__(self)
2374
class NotAMergeDirective(BzrError):
2375
"""File starting with %(firstline)r is not a merge directive"""
2376
def __init__(self, firstline):
2377
BzrError.__init__(self, firstline=firstline)
2380
class NoMergeSource(BzrError):
2381
"""Raise if no merge source was specified for a merge directive"""
2383
_fmt = "A merge directive must provide either a bundle or a public"\
2387
class IllegalMergeDirectivePayload(BzrError):
2388
"""A merge directive contained something other than a patch or bundle"""
2390
_fmt = "Bad merge directive payload %(start)r"
2392
def __init__(self, start):
2397
class PatchVerificationFailed(BzrError):
2398
"""A patch from a merge directive could not be verified"""
2400
_fmt = "Preview patch does not match requested changes."
2403
class PatchMissing(BzrError):
2404
"""Raise a patch type was specified but no patch supplied"""
2406
_fmt = "Patch_type was %(patch_type)s, but no patch was supplied."
2408
def __init__(self, patch_type):
2409
BzrError.__init__(self)
2410
self.patch_type = patch_type
2413
class TargetNotBranch(BzrError):
2414
"""A merge directive's target branch is required, but isn't a branch"""
2416
_fmt = ("Your branch does not have all of the revisions required in "
2417
"order to merge this merge directive and the target "
2418
"location specified in the merge directive is not a branch: "
2421
def __init__(self, location):
2422
BzrError.__init__(self)
2423
self.location = location
2426
class UnsupportedInventoryKind(BzrError):
2428
_fmt = """Unsupported entry kind %(kind)s"""
2430
def __init__(self, kind):
2434
class BadSubsumeSource(BzrError):
2436
_fmt = "Can't subsume %(other_tree)s into %(tree)s. %(reason)s"
2438
def __init__(self, tree, other_tree, reason):
2440
self.other_tree = other_tree
2441
self.reason = reason
2444
class SubsumeTargetNeedsUpgrade(BzrError):
2446
_fmt = """Subsume target %(other_tree)s needs to be upgraded."""
2448
def __init__(self, other_tree):
2449
self.other_tree = other_tree
2452
class BadReferenceTarget(InternalBzrError):
2454
_fmt = "Can't add reference to %(other_tree)s into %(tree)s." \
2457
def __init__(self, tree, other_tree, reason):
2459
self.other_tree = other_tree
2460
self.reason = reason
2463
class NoSuchTag(BzrError):
2465
_fmt = "No such tag: %(tag_name)s"
2467
def __init__(self, tag_name):
2468
self.tag_name = tag_name
2471
class TagsNotSupported(BzrError):
2473
_fmt = ("Tags not supported by %(branch)s;"
2474
" you may be able to use bzr upgrade.")
2476
def __init__(self, branch):
2477
self.branch = branch
2480
class TagAlreadyExists(BzrError):
2482
_fmt = "Tag %(tag_name)s already exists."
2484
def __init__(self, tag_name):
2485
self.tag_name = tag_name
2488
class MalformedBugIdentifier(BzrError):
2490
_fmt = ('Did not understand bug identifier %(bug_id)s: %(reason)s. '
2491
'See "bzr help bugs" for more information on this feature.')
2493
def __init__(self, bug_id, reason):
2494
self.bug_id = bug_id
2495
self.reason = reason
2498
class InvalidBugTrackerURL(BzrError):
2500
_fmt = ("The URL for bug tracker \"%(abbreviation)s\" doesn't "
2501
"contain {id}: %(url)s")
2503
def __init__(self, abbreviation, url):
2504
self.abbreviation = abbreviation
2508
class UnknownBugTrackerAbbreviation(BzrError):
2510
_fmt = ("Cannot find registered bug tracker called %(abbreviation)s "
2513
def __init__(self, abbreviation, branch):
2514
self.abbreviation = abbreviation
2515
self.branch = branch
2518
class InvalidLineInBugsProperty(BzrError):
2520
_fmt = ("Invalid line in bugs property: '%(line)s'")
2522
def __init__(self, line):
2526
class InvalidBugStatus(BzrError):
2528
_fmt = ("Invalid bug status: '%(status)s'")
2530
def __init__(self, status):
2531
self.status = status
2534
class UnexpectedSmartServerResponse(BzrError):
2536
_fmt = "Could not understand response from smart server: %(response_tuple)r"
2538
def __init__(self, response_tuple):
2539
self.response_tuple = response_tuple
2542
class ErrorFromSmartServer(BzrError):
2543
"""An error was received from a smart server.
2545
:seealso: UnknownErrorFromSmartServer
2548
_fmt = "Error received from smart server: %(error_tuple)r"
2550
internal_error = True
2552
def __init__(self, error_tuple):
2553
self.error_tuple = error_tuple
2555
self.error_verb = error_tuple[0]
2557
self.error_verb = None
2558
self.error_args = error_tuple[1:]
2561
class UnknownErrorFromSmartServer(BzrError):
2562
"""An ErrorFromSmartServer could not be translated into a typical bzrlib
2565
This is distinct from ErrorFromSmartServer so that it is possible to
2566
distinguish between the following two cases:
2567
- ErrorFromSmartServer was uncaught. This is logic error in the client
2568
and so should provoke a traceback to the user.
2569
- ErrorFromSmartServer was caught but its error_tuple could not be
2570
translated. This is probably because the server sent us garbage, and
2571
should not provoke a traceback.
2574
_fmt = "Server sent an unexpected error: %(error_tuple)r"
2576
internal_error = False
2578
def __init__(self, error_from_smart_server):
2581
:param error_from_smart_server: An ErrorFromSmartServer instance.
2583
self.error_from_smart_server = error_from_smart_server
2584
self.error_tuple = error_from_smart_server.error_tuple
2587
class ContainerError(BzrError):
2588
"""Base class of container errors."""
2591
class UnknownContainerFormatError(ContainerError):
2593
_fmt = "Unrecognised container format: %(container_format)r"
2595
def __init__(self, container_format):
2596
self.container_format = container_format
2599
class UnexpectedEndOfContainerError(ContainerError):
2601
_fmt = "Unexpected end of container stream"
2604
class UnknownRecordTypeError(ContainerError):
2606
_fmt = "Unknown record type: %(record_type)r"
2608
def __init__(self, record_type):
2609
self.record_type = record_type
2612
class InvalidRecordError(ContainerError):
2614
_fmt = "Invalid record: %(reason)s"
2616
def __init__(self, reason):
2617
self.reason = reason
2620
class ContainerHasExcessDataError(ContainerError):
2622
_fmt = "Container has data after end marker: %(excess)r"
2624
def __init__(self, excess):
2625
self.excess = excess
2628
class DuplicateRecordNameError(ContainerError):
2630
_fmt = "Container has multiple records with the same name: %(name)s"
2632
def __init__(self, name):
2636
class NoDestinationAddress(InternalBzrError):
2638
_fmt = "Message does not have a destination address."
2641
class RepositoryDataStreamError(BzrError):
2643
_fmt = "Corrupt or incompatible data stream: %(reason)s"
2645
def __init__(self, reason):
2646
self.reason = reason
2649
class SMTPError(BzrError):
2651
_fmt = "SMTP error: %(error)s"
2653
def __init__(self, error):
2657
class NoMessageSupplied(BzrError):
2659
_fmt = "No message supplied."
2662
class NoMailAddressSpecified(BzrError):
2664
_fmt = "No mail-to address (--mail-to) or output (-o) specified."
2667
class UnknownMailClient(BzrError):
2669
_fmt = "Unknown mail client: %(mail_client)s"
2671
def __init__(self, mail_client):
2672
BzrError.__init__(self, mail_client=mail_client)
2675
class MailClientNotFound(BzrError):
2677
_fmt = "Unable to find mail client with the following names:"\
2678
" %(mail_command_list_string)s"
2680
def __init__(self, mail_command_list):
2681
mail_command_list_string = ', '.join(mail_command_list)
2682
BzrError.__init__(self, mail_command_list=mail_command_list,
2683
mail_command_list_string=mail_command_list_string)
2685
class SMTPConnectionRefused(SMTPError):
2687
_fmt = "SMTP connection to %(host)s refused"
2689
def __init__(self, error, host):
2694
class DefaultSMTPConnectionRefused(SMTPConnectionRefused):
2696
_fmt = "Please specify smtp_server. No server at default %(host)s."
2699
class BzrDirError(BzrError):
2701
def __init__(self, bzrdir):
2702
import bzrlib.urlutils as urlutils
2703
display_url = urlutils.unescape_for_display(bzrdir.root_transport.base,
2705
BzrError.__init__(self, bzrdir=bzrdir, display_url=display_url)
2708
class UnsyncedBranches(BzrDirError):
2710
_fmt = ("'%(display_url)s' is not in sync with %(target_url)s. See"
2711
" bzr help sync-for-reconfigure.")
2713
def __init__(self, bzrdir, target_branch):
2714
BzrDirError.__init__(self, bzrdir)
2715
import bzrlib.urlutils as urlutils
2716
self.target_url = urlutils.unescape_for_display(target_branch.base,
2720
class AlreadyBranch(BzrDirError):
2722
_fmt = "'%(display_url)s' is already a branch."
2725
class AlreadyTree(BzrDirError):
2727
_fmt = "'%(display_url)s' is already a tree."
2730
class AlreadyCheckout(BzrDirError):
2732
_fmt = "'%(display_url)s' is already a checkout."
2735
class AlreadyLightweightCheckout(BzrDirError):
2737
_fmt = "'%(display_url)s' is already a lightweight checkout."
2740
class AlreadyUsingShared(BzrDirError):
2742
_fmt = "'%(display_url)s' is already using a shared repository."
2745
class AlreadyStandalone(BzrDirError):
2747
_fmt = "'%(display_url)s' is already standalone."
2750
class AlreadyWithTrees(BzrDirError):
2752
_fmt = ("Shared repository '%(display_url)s' already creates "
2756
class AlreadyWithNoTrees(BzrDirError):
2758
_fmt = ("Shared repository '%(display_url)s' already doesn't create "
2762
class ReconfigurationNotSupported(BzrDirError):
2764
_fmt = "Requested reconfiguration of '%(display_url)s' is not supported."
2767
class NoBindLocation(BzrDirError):
2769
_fmt = "No location could be found to bind to at %(display_url)s."
2772
class UncommittedChanges(BzrError):
2774
_fmt = 'Working tree "%(display_url)s" has uncommitted changes.'
2776
def __init__(self, tree):
2777
import bzrlib.urlutils as urlutils
2778
display_url = urlutils.unescape_for_display(
2779
tree.bzrdir.root_transport.base, 'ascii')
2780
BzrError.__init__(self, tree=tree, display_url=display_url)
2783
class MissingTemplateVariable(BzrError):
2785
_fmt = 'Variable {%(name)s} is not available.'
2787
def __init__(self, name):
2791
class NoTemplate(BzrError):
2793
_fmt = 'No template specified.'
2796
class UnableCreateSymlink(BzrError):
2798
_fmt = 'Unable to create symlink %(path_str)son this platform'
2800
def __init__(self, path=None):
2804
path_str = repr(str(path))
2805
except UnicodeEncodeError:
2806
path_str = repr(path)
2808
self.path_str = path_str
2811
class UnsupportedTimezoneFormat(BzrError):
2813
_fmt = ('Unsupported timezone format "%(timezone)s", '
2814
'options are "utc", "original", "local".')
2816
def __init__(self, timezone):
2817
self.timezone = timezone
2820
class CommandAvailableInPlugin(StandardError):
2822
internal_error = False
2824
def __init__(self, cmd_name, plugin_metadata, provider):
2826
self.plugin_metadata = plugin_metadata
2827
self.cmd_name = cmd_name
2828
self.provider = provider
2832
_fmt = ('"%s" is not a standard bzr command. \n'
2833
'However, the following official plugin provides this command: %s\n'
2834
'You can install it by going to: %s'
2835
% (self.cmd_name, self.plugin_metadata['name'],
2836
self.plugin_metadata['url']))
2841
class NoPluginAvailable(BzrError):
2845
class UnableEncodePath(BzrError):
2847
_fmt = ('Unable to encode %(kind)s path %(path)r in '
2848
'user encoding %(user_encoding)s')
2850
def __init__(self, path, kind):
2851
from bzrlib.osutils import get_user_encoding
2854
self.user_encoding = osutils.get_user_encoding()
2857
class NoSuchAlias(BzrError):
2859
_fmt = ('The alias "%(alias_name)s" does not exist.')
2861
def __init__(self, alias_name):
2862
BzrError.__init__(self, alias_name=alias_name)
2865
class DirectoryLookupFailure(BzrError):
2866
"""Base type for lookup errors."""
2871
class InvalidLocationAlias(DirectoryLookupFailure):
2873
_fmt = '"%(alias_name)s" is not a valid location alias.'
2875
def __init__(self, alias_name):
2876
DirectoryLookupFailure.__init__(self, alias_name=alias_name)
2879
class UnsetLocationAlias(DirectoryLookupFailure):
2881
_fmt = 'No %(alias_name)s location assigned.'
2883
def __init__(self, alias_name):
2884
DirectoryLookupFailure.__init__(self, alias_name=alias_name[1:])
2887
class CannotBindAddress(BzrError):
2889
_fmt = 'Cannot bind address "%(host)s:%(port)i": %(orig_error)s.'
2891
def __init__(self, host, port, orig_error):
2892
BzrError.__init__(self, host=host, port=port,
2893
orig_error=orig_error[1])
2896
class UnknownRules(BzrError):
2898
_fmt = ('Unknown rules detected: %(unknowns_str)s.')
2900
def __init__(self, unknowns):
2901
BzrError.__init__(self, unknowns_str=", ".join(unknowns))
2904
class HookFailed(BzrError):
2905
"""Raised when a pre_change_branch_tip hook function fails anything other
2906
than TipChangeRejected.
2909
_fmt = ("Hook '%(hook_name)s' during %(hook_stage)s failed:\n"
2910
"%(traceback_text)s%(exc_value)s")
2912
def __init__(self, hook_stage, hook_name, exc_info):
2914
self.hook_stage = hook_stage
2915
self.hook_name = hook_name
2916
self.exc_info = exc_info
2917
self.exc_type = exc_info[0]
2918
self.exc_value = exc_info[1]
2919
self.exc_tb = exc_info[2]
2920
self.traceback_text = ''.join(traceback.format_tb(self.exc_tb))
2923
class TipChangeRejected(BzrError):
2924
"""A pre_change_branch_tip hook function may raise this to cleanly and
2925
explicitly abort a change to a branch tip.
2928
_fmt = u"Tip change rejected: %(msg)s"
2930
def __init__(self, msg):
2934
class ShelfCorrupt(BzrError):
2936
_fmt = "Shelf corrupt."
2939
class NoSuchShelfId(BzrError):
2941
_fmt = 'No changes are shelved with id "%(shelf_id)d".'
2943
def __init__(self, shelf_id):
2944
BzrError.__init__(self, shelf_id=shelf_id)
2947
class InvalidShelfId(BzrError):
2949
_fmt = '"%(invalid_id)s" is not a valid shelf id, try a number instead.'
2951
def __init__(self, invalid_id):
2952
BzrError.__init__(self, invalid_id=invalid_id)
2955
class JailBreak(BzrError):
2957
_fmt = "An attempt to access a url outside the server jail was made: '%(url)s'."
2959
def __init__(self, url):
2960
BzrError.__init__(self, url=url)
2963
class UserAbort(BzrError):
2965
_fmt = 'The user aborted the operation.'
2968
class MustHaveWorkingTree(BzrError):
2970
_fmt = ("Branching '%(url)s'(%(format)s) must create a working tree.")
2972
def __init__(self, format, url):
2973
BzrError.__init__(self, format=format, url=url)
2976
class NoSuchView(BzrError):
2977
"""A view does not exist.
2980
_fmt = u"No such view: %(view_name)s."
2982
def __init__(self, view_name):
2983
self.view_name = view_name
2986
class ViewsNotSupported(BzrError):
2987
"""Views are not supported by a tree format.
2990
_fmt = ("Views are not supported by %(tree)s;"
2991
" use 'bzr upgrade' to change your tree to a later format.")
2993
def __init__(self, tree):
2997
class FileOutsideView(BzrError):
2999
_fmt = ('Specified file "%(file_name)s" is outside the current view: '
3002
def __init__(self, file_name, view_files):
3003
self.file_name = file_name
3004
self.view_str = ", ".join(view_files)
3007
class UnresumableWriteGroup(BzrError):
3009
_fmt = ("Repository %(repository)s cannot resume write group "
3010
"%(write_groups)r: %(reason)s")
3012
internal_error = True
3014
def __init__(self, repository, write_groups, reason):
3015
self.repository = repository
3016
self.write_groups = write_groups
3017
self.reason = reason
3020
class UnsuspendableWriteGroup(BzrError):
3022
_fmt = ("Repository %(repository)s cannot suspend a write group.")
3024
internal_error = True
3026
def __init__(self, repository):
3027
self.repository = repository