/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Robert Collins
  • Date: 2007-04-23 02:29:35 UTC
  • mfrom: (2441 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2442.
  • Revision ID: robertc@robertcollins.net-20070423022935-9hhongamvk6bfdso
Resolve conflicts with bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
    # readable explanation
133
133
 
134
134
    def __init__(self, *args, **kwds):
135
 
        # XXX: Use the underlying BzrError to always generate the args attribute
136
 
        # if it doesn't exist.  We can't use super here, because exceptions are
137
 
        # old-style classes in python2.4 (but new in 2.5).  --bmc, 20060426
 
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).
 
138
        # --bmc, 20060426
138
139
        symbol_versioning.warn('BzrNewError was deprecated in bzr 0.13; '
139
 
             'please convert %s to use BzrError instead' 
 
140
             'please convert %s to use BzrError instead'
140
141
             % self.__class__.__name__,
141
142
             DeprecationWarning,
142
143
             stacklevel=2)
174
175
        self.message = message
175
176
 
176
177
 
 
178
class DisabledMethod(BzrError):
 
179
 
 
180
    _fmt = "The smart server method '%(class_name)s' is disabled."
 
181
 
 
182
    internal_error = True
 
183
 
 
184
    def __init__(self, class_name):
 
185
        BzrError.__init__(self)
 
186
        self.class_name = class_name
 
187
 
 
188
 
177
189
class InvalidEntryName(BzrError):
178
190
    
179
191
    _fmt = "Invalid entry name: %(name)s"
211
223
    def __init__(self, revision_id):
212
224
        self.revision_id = revision_id
213
225
 
 
226
 
 
227
class NoHelpTopic(BzrError):
 
228
 
 
229
    _fmt = ("No help could be found for '%(topic)s'. "
 
230
        "Please use 'bzr help topics' to obtain a list of topics.")
 
231
 
 
232
    def __init__(self, topic):
 
233
        self.topic = topic
 
234
 
 
235
 
214
236
class NoSuchId(BzrError):
215
237
 
216
238
    _fmt = "The file id %(file_id)s is not present in the tree %(tree)s."
223
245
 
224
246
class InventoryModified(BzrError):
225
247
 
226
 
    _fmt = ("The current inventory for the tree %(tree)r has been modified, "
227
 
            "so a clean inventory cannot be read without data loss.")
 
248
    _fmt = ("The current inventory for the tree %(tree)r has been modified,"
 
249
            " so a clean inventory cannot be read without data loss.")
228
250
 
229
251
    internal_error = True
230
252
 
342
364
    """Used when renaming and both source and dest exist."""
343
365
 
344
366
    _fmt = ("Could not rename %(source)s => %(dest)s because both files exist."
345
 
         "%(extra)s")
 
367
            "%(extra)s")
346
368
 
347
369
    def __init__(self, source, dest, extra=None):
348
370
        BzrError.__init__(self)
425
447
 
426
448
class ShortReadvError(PathError):
427
449
 
428
 
    _fmt = "readv() read %(actual)s bytes rather than %(length)s bytes at %(offset)s for %(path)s%(extra)s"
 
450
    _fmt = ("readv() read %(actual)s bytes rather than %(length)s bytes"
 
451
            " at %(offset)s for %(path)s%(extra)s")
429
452
 
430
453
    internal_error = True
431
454
 
469
492
       self.path = urlutils.unescape_for_display(path, 'ascii')
470
493
 
471
494
 
 
495
class NoSubmitBranch(PathError):
 
496
 
 
497
    _fmt = 'No submit branch available for branch "%(path)s"'
 
498
 
 
499
    def __init__(self, branch):
 
500
       import bzrlib.urlutils as urlutils
 
501
       self.path = urlutils.unescape_for_display(branch.base, 'ascii')
 
502
 
 
503
 
472
504
class AlreadyBranchError(PathError):
473
505
 
474
506
    _fmt = "Already a branch: %(path)s."
482
514
 
483
515
class AtomicFileAlreadyClosed(PathError):
484
516
 
485
 
    _fmt = "'%(function)s' called on an AtomicFile after it was closed: %(path)s"
 
517
    _fmt = ("'%(function)s' called on an AtomicFile after it was closed:"
 
518
            " %(path)s")
486
519
 
487
520
    def __init__(self, path, function):
488
521
        PathError.__init__(self, path=path, extra=None)
491
524
 
492
525
class InaccessibleParent(PathError):
493
526
 
494
 
    _fmt = "Parent not accessible given base %(base)s and relative path %(path)s"
 
527
    _fmt = ("Parent not accessible given base %(base)s and"
 
528
            " relative path %(path)s")
495
529
 
496
530
    def __init__(self, path, base):
497
531
        PathError.__init__(self, path)
518
552
 
519
553
 
520
554
class UnsupportedFormatError(BzrError):
521
 
    
522
 
    _fmt = "Unsupported branch format: %(format)s"
 
555
 
 
556
    _fmt = "Unsupported branch format: %(format)s\nPlease run 'bzr upgrade'"
523
557
 
524
558
 
525
559
class UnknownFormatError(BzrError):
537
571
        self.bzrdir = bzrdir_format
538
572
 
539
573
 
 
574
class IncompatibleRepositories(BzrError):
 
575
 
 
576
    _fmt = "Repository %(target)s is not compatible with repository"\
 
577
        " %(source)s"
 
578
 
 
579
    def __init__(self, source, target):
 
580
        BzrError.__init__(self, target=target, source=source)
 
581
 
 
582
 
540
583
class IncompatibleRevision(BzrError):
541
584
    
542
585
    _fmt = "Revision is not compatible with %(repo_format)s"
634
677
 
635
678
class LockError(BzrError):
636
679
 
637
 
    _fmt = "Lock error: %(message)s"
 
680
    _fmt = "Lock error: %(msg)s"
638
681
 
639
682
    internal_error = True
640
683
 
644
687
    #
645
688
    # New code should prefer to raise specific subclasses
646
689
    def __init__(self, message):
647
 
        self.message = message
 
690
        # Python 2.5 uses a slot for StandardError.message,
 
691
        # so use a different variable name
 
692
        # so it is exposed in self.__dict__
 
693
        self.msg = message
648
694
 
649
695
 
650
696
class LockActive(LockError):
684
730
        self.obj = obj
685
731
 
686
732
 
 
733
class ReadOnlyLockError(LockError):
 
734
 
 
735
    _fmt = "Cannot acquire write lock on %(fname)s. %(msg)s"
 
736
 
 
737
    def __init__(self, fname, msg):
 
738
        LockError.__init__(self, '')
 
739
        self.fname = fname
 
740
        self.msg = msg
 
741
 
 
742
 
687
743
class OutSideTransaction(BzrError):
688
744
 
689
 
    _fmt = "A transaction related operation was attempted after the transaction finished."
 
745
    _fmt = ("A transaction related operation was attempted after"
 
746
            " the transaction finished.")
690
747
 
691
748
 
692
749
class ObjectNotLocked(LockError):
723
780
    # bits?
724
781
 
725
782
    internal_error = False
726
 
    
 
783
 
727
784
    def __init__(self, lock):
728
785
        self.lock = lock
729
786
 
730
787
 
731
788
class LockBroken(LockError):
732
789
 
733
 
    _fmt = "Lock was broken while still open: %(lock)s - check storage consistency!"
 
790
    _fmt = ("Lock was broken while still open: %(lock)s"
 
791
            " - check storage consistency!")
734
792
 
735
793
    internal_error = False
736
794
 
740
798
 
741
799
class LockBreakMismatch(LockError):
742
800
 
743
 
    _fmt = "Lock was released and re-acquired before being broken: %(lock)s: held by %(holder)r, wanted to break %(target)r"
 
801
    _fmt = ("Lock was released and re-acquired before being broken:"
 
802
            " %(lock)s: held by %(holder)r, wanted to break %(target)r")
744
803
 
745
804
    internal_error = False
746
805
 
760
819
        self.lock = lock
761
820
 
762
821
 
 
822
class TokenLockingNotSupported(LockError):
 
823
 
 
824
    _fmt = "The object %(obj)s does not support token specifying a token when locking."
 
825
 
 
826
    internal_error = True
 
827
 
 
828
    def __init__(self, obj):
 
829
        self.obj = obj
 
830
 
 
831
 
 
832
class TokenMismatch(LockBroken):
 
833
 
 
834
    _fmt = "The lock token %(given_token)r does not match lock token %(lock_token)r."
 
835
 
 
836
    internal_error = True
 
837
 
 
838
    def __init__(self, given_token, lock_token):
 
839
        self.given_token = given_token
 
840
        self.lock_token = lock_token
 
841
 
 
842
 
763
843
class PointlessCommit(BzrError):
764
844
 
765
845
    _fmt = "No changes to commit"
796
876
 
797
877
class NotLeftParentDescendant(BzrError):
798
878
 
799
 
    _fmt = "Revision %(old_revision)s is not the left parent of"\
800
 
        " %(new_revision)s, but branch %(branch_location)s expects this"
 
879
    _fmt = ("Revision %(old_revision)s is not the left parent of"
 
880
            " %(new_revision)s, but branch %(branch_location)s expects this")
801
881
 
802
882
    internal_error = True
803
883
 
828
908
 
829
909
class InvalidRevisionSpec(BzrError):
830
910
 
831
 
    _fmt = "Requested revision: %(spec)r does not exist in branch: %(branch)s%(extra)s"
 
911
    _fmt = ("Requested revision: %(spec)r does not exist in branch:"
 
912
            " %(branch)s%(extra)s")
832
913
 
833
914
    def __init__(self, spec, branch, extra=None):
834
915
        BzrError.__init__(self, branch=branch, spec=spec)
845
926
 
846
927
class AppendRevisionsOnlyViolation(BzrError):
847
928
 
848
 
    _fmt = 'Operation denied because it would change the main history, '\
849
 
           'which is not permitted by the append_revisions_only setting on'\
850
 
           ' branch "%(location)s".'
 
929
    _fmt = ('Operation denied because it would change the main history,'
 
930
           ' which is not permitted by the append_revisions_only setting on'
 
931
           ' branch "%(location)s".')
851
932
 
852
933
    def __init__(self, location):
853
934
       import bzrlib.urlutils as urlutils
856
937
 
857
938
 
858
939
class DivergedBranches(BzrError):
859
 
    
860
 
    _fmt = "These branches have diverged.  Use the merge command to reconcile them."""
 
940
 
 
941
    _fmt = ("These branches have diverged."
 
942
            " Use the merge command to reconcile them.")
861
943
 
862
944
    internal_error = False
863
945
 
878
960
 
879
961
class UnrelatedBranches(BzrError):
880
962
 
881
 
    _fmt = "Branches have no common ancestor, and no merge base revision was specified."
 
963
    _fmt = ("Branches have no common ancestor, and"
 
964
            " no merge base revision was specified.")
882
965
 
883
966
    internal_error = False
884
967
 
894
977
 
895
978
class NoCommonRoot(BzrError):
896
979
 
897
 
    _fmt = "Revisions are not derived from the same root: " \
898
 
           "%(revision_a)s %(revision_b)s."
 
980
    _fmt = ("Revisions are not derived from the same root: "
 
981
           "%(revision_a)s %(revision_b)s.")
899
982
 
900
983
    def __init__(self, revision_a, revision_b):
901
984
        BzrError.__init__(self, revision_a=revision_a, revision_b=revision_b)
924
1007
    def __init__(self, bases):
925
1008
        warn("BzrError AmbiguousBase has been deprecated as of bzrlib 0.8.",
926
1009
                DeprecationWarning)
927
 
        msg = "The correct base is unclear, because %s are all equally close" %\
928
 
            ", ".join(bases)
 
1010
        msg = ("The correct base is unclear, because %s are all equally close"
 
1011
                % ", ".join(bases))
929
1012
        BzrError.__init__(self, msg)
930
1013
        self.bases = bases
931
1014
 
953
1036
 
954
1037
class BoundBranchOutOfDate(BzrError):
955
1038
 
956
 
    _fmt = "Bound branch %(branch)s is out of date with master branch %(master)s."
 
1039
    _fmt = ("Bound branch %(branch)s is out of date"
 
1040
            " with master branch %(master)s.")
957
1041
 
958
1042
    def __init__(self, branch, master):
959
1043
        BzrError.__init__(self)
963
1047
        
964
1048
class CommitToDoubleBoundBranch(BzrError):
965
1049
 
966
 
    _fmt = "Cannot commit to branch %(branch)s. It is bound to %(master)s, which is bound to %(remote)s."
 
1050
    _fmt = ("Cannot commit to branch %(branch)s."
 
1051
            " It is bound to %(master)s, which is bound to %(remote)s.")
967
1052
 
968
1053
    def __init__(self, branch, master, remote):
969
1054
        BzrError.__init__(self)
983
1068
 
984
1069
class BoundBranchConnectionFailure(BzrError):
985
1070
 
986
 
    _fmt = "Unable to connect to target of bound branch %(branch)s => %(target)s: %(error)s"
 
1071
    _fmt = ("Unable to connect to target of bound branch %(branch)s"
 
1072
            " => %(target)s: %(error)s")
987
1073
 
988
1074
    def __init__(self, branch, target, error):
989
1075
        BzrError.__init__(self)
1043
1129
 
1044
1130
class WeaveTextDiffers(WeaveError):
1045
1131
 
1046
 
    _fmt = "Weaves differ on text content. Revision: {%(revision_id)s}, %(weave_a)s, %(weave_b)s"
 
1132
    _fmt = ("Weaves differ on text content. Revision:"
 
1133
            " {%(revision_id)s}, %(weave_a)s, %(weave_b)s")
1047
1134
 
1048
1135
    def __init__(self, revision_id, weave_a, weave_b):
1049
1136
        WeaveError.__init__(self)
1054
1141
 
1055
1142
class WeaveTextDiffers(WeaveError):
1056
1143
 
1057
 
    _fmt = "Weaves differ on text content. Revision: {%(revision_id)s}, %(weave_a)s, %(weave_b)s"
 
1144
    _fmt = ("Weaves differ on text content. Revision:"
 
1145
            " {%(revision_id)s}, %(weave_a)s, %(weave_b)s")
1058
1146
 
1059
1147
    def __init__(self, revision_id, weave_a, weave_b):
1060
1148
        WeaveError.__init__(self)
1157
1245
 
1158
1246
class TooManyConcurrentRequests(BzrError):
1159
1247
 
1160
 
    _fmt = ("The medium '%(medium)s' has reached its concurrent request limit. "
1161
 
            "Be sure to finish_writing and finish_reading on the "
1162
 
            "current request that is open.")
 
1248
    _fmt = ("The medium '%(medium)s' has reached its concurrent request limit."
 
1249
            " Be sure to finish_writing and finish_reading on the"
 
1250
            " currently open request.")
1163
1251
 
1164
1252
    internal_error = True
1165
1253
 
1248
1336
        InvalidHttpResponse.__init__(self, path, msg)
1249
1337
 
1250
1338
 
 
1339
class RedirectRequested(TransportError):
 
1340
 
 
1341
    _fmt = '%(source)s is%(permanently)s redirected to %(target)s'
 
1342
 
 
1343
    def __init__(self, source, target, is_permament=False, qual_proto=None):
 
1344
        self.source = source
 
1345
        self.target = target
 
1346
        if is_permament:
 
1347
            self.permanently = ' permanently'
 
1348
        else:
 
1349
            self.permanently = ''
 
1350
        self.is_permament = is_permament
 
1351
        self._qualified_proto = qual_proto
 
1352
        TransportError.__init__(self)
 
1353
 
 
1354
    def _requalify_url(self, url):
 
1355
        """Restore the qualified proto in front of the url"""
 
1356
        # When this exception is raised, source and target are in
 
1357
        # user readable format. But some transports may use a
 
1358
        # different proto (http+urllib:// will present http:// to
 
1359
        # the user. If a qualified proto is specified, the code
 
1360
        # trapping the exception can get the qualified urls to
 
1361
        # properly handle the redirection themself (creating a
 
1362
        # new transport object from the target url for example).
 
1363
        # But checking that the scheme of the original and
 
1364
        # redirected urls are the same can be tricky. (see the
 
1365
        # FIXME in BzrDir.open_from_transport for the unique use
 
1366
        # case so far).
 
1367
        if self._qualified_proto is None:
 
1368
            return url
 
1369
 
 
1370
        # The TODO related to NotBranchError mention that doing
 
1371
        # that kind of manipulation on the urls may not be the
 
1372
        # exception object job. On the other hand, this object is
 
1373
        # the interface between the code and the user so
 
1374
        # presenting the urls in different ways is indeed its
 
1375
        # job...
 
1376
        import urlparse
 
1377
        proto, netloc, path, query, fragment = urlparse.urlsplit(url)
 
1378
        return urlparse.urlunsplit((self._qualified_proto, netloc, path,
 
1379
                                   query, fragment))
 
1380
 
 
1381
    def get_source_url(self):
 
1382
        return self._requalify_url(self.source)
 
1383
 
 
1384
    def get_target_url(self):
 
1385
        return self._requalify_url(self.target)
 
1386
 
 
1387
 
 
1388
class TooManyRedirections(TransportError):
 
1389
 
 
1390
    _fmt = "Too many redirections"
 
1391
 
1251
1392
class ConflictsInTree(BzrError):
1252
1393
 
1253
1394
    _fmt = "Working tree has conflicts."
1292
1433
 
1293
1434
class CantReprocessAndShowBase(BzrError):
1294
1435
 
1295
 
    _fmt = "Can't reprocess and show base, because reprocessing obscures " \
1296
 
           "the relationship of conflicting lines to the base"
 
1436
    _fmt = ("Can't reprocess and show base, because reprocessing obscures "
 
1437
           "the relationship of conflicting lines to the base")
1297
1438
 
1298
1439
 
1299
1440
class GraphCycleError(BzrError):
1348
1489
 
1349
1490
 
1350
1491
class MustUseDecorated(Exception):
1351
 
    
1352
 
    _fmt = """A decorating function has requested its original command be used."""
1353
 
    
 
1492
 
 
1493
    _fmt = "A decorating function has requested its original command be used."
 
1494
 
1354
1495
 
1355
1496
class NoBundleFound(BzrError):
1356
1497
 
1373
1514
 
1374
1515
class MissingText(BzrError):
1375
1516
 
1376
 
    _fmt = "Branch %(base)s is missing revision %(text_revision)s of %(file_id)s"
 
1517
    _fmt = ("Branch %(base)s is missing revision"
 
1518
            " %(text_revision)s of %(file_id)s")
1377
1519
 
1378
1520
    def __init__(self, branch, text_revision, file_id):
1379
1521
        BzrError.__init__(self)
1398
1540
    _fmt = "Key %(key)s is already present in map"
1399
1541
 
1400
1542
 
 
1543
class DuplicateHelpPrefix(BzrError):
 
1544
 
 
1545
    _fmt = "The prefix %(prefix)s is in the help search path twice."
 
1546
 
 
1547
    def __init__(self, prefix):
 
1548
        self.prefix = prefix
 
1549
 
 
1550
 
1401
1551
class MalformedTransform(BzrError):
1402
1552
 
1403
1553
    _fmt = "Tree transform is malformed %(conflicts)r"
1496
1646
 
1497
1647
class BzrBadParameterUnicode(BzrBadParameter):
1498
1648
 
1499
 
    _fmt = "Parameter %(param)s is unicode but only byte-strings are permitted."
 
1649
    _fmt = ("Parameter %(param)s is unicode but"
 
1650
            " only byte-strings are permitted.")
1500
1651
 
1501
1652
 
1502
1653
class BzrBadParameterContainsNewline(BzrBadParameter):
1588
1739
        self.tree = tree
1589
1740
 
1590
1741
 
 
1742
class PublicBranchOutOfDate(BzrError):
 
1743
 
 
1744
    _fmt = 'Public branch "%(public_location)s" lacks revision '\
 
1745
        '"%(revstring)s".'
 
1746
 
 
1747
    def __init__(self, public_location, revstring):
 
1748
        import bzrlib.urlutils as urlutils
 
1749
        public_location = urlutils.unescape_for_display(public_location,
 
1750
                                                        'ascii')
 
1751
        BzrError.__init__(self, public_location=public_location,
 
1752
                          revstring=revstring)
 
1753
 
 
1754
 
1591
1755
class MergeModifiedFormatError(BzrError):
1592
1756
 
1593
1757
    _fmt = "Error in merge modified format"
1600
1764
 
1601
1765
class CorruptRepository(BzrError):
1602
1766
 
1603
 
    _fmt = """An error has been detected in the repository %(repo_path)s.
1604
 
Please run bzr reconcile on this repository."""
 
1767
    _fmt = ("An error has been detected in the repository %(repo_path)s.\n"
 
1768
            "Please run bzr reconcile on this repository.")
1605
1769
 
1606
1770
    def __init__(self, repo):
1607
1771
        BzrError.__init__(self)
1629
1793
 
1630
1794
class InvalidProgressBarType(BzrError):
1631
1795
 
1632
 
    _fmt = """Environment variable BZR_PROGRESS_BAR='%(bar_type)s is not a supported type
1633
 
Select one of: %(valid_types)s"""
 
1796
    _fmt = ("Environment variable BZR_PROGRESS_BAR='%(bar_type)s"
 
1797
            " is not a supported type Select one of: %(valid_types)s")
1634
1798
 
1635
1799
    def __init__(self, bar_type, valid_types):
1636
1800
        BzrError.__init__(self, bar_type=bar_type, valid_types=valid_types)
1638
1802
 
1639
1803
class UnsupportedOperation(BzrError):
1640
1804
 
1641
 
    _fmt = "The method %(mname)s is not supported on objects of type %(tname)s."
 
1805
    _fmt = ("The method %(mname)s is not supported on"
 
1806
            " objects of type %(tname)s.")
1642
1807
 
1643
1808
    def __init__(self, method, method_self):
1644
1809
        self.method = method
1651
1816
 
1652
1817
 
1653
1818
class NonAsciiRevisionId(UnsupportedOperation):
1654
 
    """Raised when a commit is attempting to set a non-ascii revision id but cant."""
 
1819
    """Raised when a commit is attempting to set a non-ascii revision id
 
1820
       but cant.
 
1821
    """
1655
1822
 
1656
1823
 
1657
1824
class BinaryFile(BzrError):
1670
1837
 
1671
1838
class TestamentMismatch(BzrError):
1672
1839
 
1673
 
    _fmt = """Testament did not match expected value.  
1674
 
       For revision_id {%(revision_id)s}, expected {%(expected)s}, measured 
 
1840
    _fmt = """Testament did not match expected value.
 
1841
       For revision_id {%(revision_id)s}, expected {%(expected)s}, measured
1675
1842
       {%(measured)s}"""
1676
1843
 
1677
1844
    def __init__(self, revision_id, expected, measured):
1778
1945
        self.vendor = vendor
1779
1946
 
1780
1947
 
 
1948
class SSHVendorNotFound(BzrError):
 
1949
 
 
1950
    _fmt = ("Don't know how to handle SSH connections."
 
1951
            " Please set BZR_SSH environment variable.")
 
1952
 
 
1953
 
1781
1954
class GhostRevisionUnusableHere(BzrError):
1782
1955
 
1783
1956
    _fmt = "Ghost revision {%(revision_id)s} cannot be used here."
1789
1962
 
1790
1963
class IllegalUseOfScopeReplacer(BzrError):
1791
1964
 
1792
 
    _fmt = "ScopeReplacer object %(name)r was used incorrectly: %(msg)s%(extra)s"
 
1965
    _fmt = ("ScopeReplacer object %(name)r was used incorrectly:"
 
1966
            " %(msg)s%(extra)s")
1793
1967
 
1794
1968
    internal_error = True
1795
1969
 
1817
1991
 
1818
1992
class ImportNameCollision(BzrError):
1819
1993
 
1820
 
    _fmt = "Tried to import an object to the same name as an existing object. %(name)s"
 
1994
    _fmt = ("Tried to import an object to the same name as"
 
1995
            " an existing object. %(name)s")
1821
1996
 
1822
1997
    internal_error = True
1823
1998
 
1826
2001
        self.name = name
1827
2002
 
1828
2003
 
 
2004
class NotAMergeDirective(BzrError):
 
2005
    """File starting with %(firstline)r is not a merge directive"""
 
2006
    def __init__(self, firstline):
 
2007
        BzrError.__init__(self, firstline=firstline)
 
2008
 
 
2009
 
 
2010
class NoMergeSource(BzrError):
 
2011
    """Raise if no merge source was specified for a merge directive"""
 
2012
 
 
2013
    _fmt = "A merge directive must provide either a bundle or a public"\
 
2014
        " branch location."
 
2015
 
 
2016
 
 
2017
class PatchMissing(BzrError):
 
2018
    """Raise a patch type was specified but no patch supplied"""
 
2019
 
 
2020
    _fmt = "patch_type was %(patch_type)s, but no patch was supplied."
 
2021
 
 
2022
    def __init__(self, patch_type):
 
2023
        BzrError.__init__(self)
 
2024
        self.patch_type = patch_type
 
2025
 
 
2026
 
1829
2027
class UnsupportedInventoryKind(BzrError):
1830
2028
    
1831
2029
    _fmt = """Unsupported entry kind %(kind)s"""
1874
2072
 
1875
2073
class TagsNotSupported(BzrError):
1876
2074
 
1877
 
    _fmt = "Tags not supported by %(branch)s; you may be able to use bzr upgrade."
 
2075
    _fmt = ("Tags not supported by %(branch)s;"
 
2076
            " you may be able to use bzr upgrade --dirstate-tags.")
1878
2077
 
1879
2078
    def __init__(self, branch):
1880
2079
        self.branch = branch
1886
2085
 
1887
2086
    def __init__(self, tag_name):
1888
2087
        self.tag_name = tag_name
 
2088
 
 
2089
 
 
2090
class UnexpectedSmartServerResponse(BzrError):
 
2091
 
 
2092
    _fmt = "Could not understand response from smart server: %(response_tuple)r"
 
2093
 
 
2094
    def __init__(self, response_tuple):
 
2095
        self.response_tuple = response_tuple
 
2096