/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: Benoît Pierre
  • Date: 2009-02-24 00:25:32 UTC
  • mfrom: (4035 +trunk)
  • mto: (4056.1.1 trunk2)
  • mto: This revision was merged to the branch mainline in revision 4058.
  • Revision ID: benoit.pierre@gmail.com-20090224002532-i2f64ou15pa7if2y
Merge with upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Exceptions for bzr, and reporting of them.
18
18
"""
19
19
 
20
 
 
21
20
from bzrlib import (
22
21
    osutils,
23
22
    symbol_versioning,
32
31
 
33
32
 
34
33
# TODO: is there any value in providing the .args field used by standard
35
 
# python exceptions?   A list of values with no names seems less useful 
 
34
# python exceptions?   A list of values with no names seems less useful
36
35
# to me.
37
36
 
38
 
# TODO: Perhaps convert the exception to a string at the moment it's 
 
37
# TODO: Perhaps convert the exception to a string at the moment it's
39
38
# constructed to make sure it will succeed.  But that says nothing about
40
39
# exceptions that are never raised.
41
40
 
62
61
    :cvar _fmt: Format string to display the error; this is expanded
63
62
    by the instance's dict.
64
63
    """
65
 
    
 
64
 
66
65
    internal_error = False
67
66
 
68
67
    def __init__(self, msg=None, **kwds):
73
72
        arguments can be given.  The first is for generic "user" errors which
74
73
        are not intended to be caught and so do not need a specific subclass.
75
74
        The second case is for use with subclasses that provide a _fmt format
76
 
        string to print the arguments.  
 
75
        string to print the arguments.
77
76
 
78
 
        Keyword arguments are taken as parameters to the error, which can 
79
 
        be inserted into the format string template.  It's recommended 
80
 
        that subclasses override the __init__ method to require specific 
 
77
        Keyword arguments are taken as parameters to the error, which can
 
78
        be inserted into the format string template.  It's recommended
 
79
        that subclasses override the __init__ method to require specific
81
80
        parameters.
82
81
 
83
82
        :param msg: If given, this is the literal complete text for the error,
266
265
 
267
266
 
268
267
class InvalidEntryName(InternalBzrError):
269
 
    
 
268
 
270
269
    _fmt = "Invalid entry name: %(name)s"
271
270
 
272
271
    def __init__(self, name):
275
274
 
276
275
 
277
276
class InvalidRevisionNumber(BzrError):
278
 
    
 
277
 
279
278
    _fmt = "Invalid revision number %(revno)s"
280
279
 
281
280
    def __init__(self, revno):
330
329
class NoSuchId(BzrError):
331
330
 
332
331
    _fmt = 'The file id "%(file_id)s" is not present in the tree %(tree)s.'
333
 
    
 
332
 
334
333
    def __init__(self, tree, file_id):
335
334
        BzrError.__init__(self)
336
335
        self.file_id = file_id
363
362
class NoWorkingTree(BzrError):
364
363
 
365
364
    _fmt = 'No WorkingTree exists for "%(base)s".'
366
 
    
 
365
 
367
366
    def __init__(self, base):
368
367
        BzrError.__init__(self)
369
368
        self.base = base
478
477
    def __init__(self, name, value):
479
478
        BzrError.__init__(self, name=name, value=value)
480
479
 
481
 
    
 
480
 
482
481
class StrictCommitFailed(BzrError):
483
482
 
484
483
    _fmt = "Commit refused because there are unknown files in the tree"
487
486
# XXX: Should be unified with TransportError; they seem to represent the
488
487
# same thing
489
488
# RBC 20060929: I think that unifiying with TransportError would be a mistake
490
 
# - this is finer than a TransportError - and more useful as such. It 
 
489
# - this is finer than a TransportError - and more useful as such. It
491
490
# differentiates between 'transport has failed' and 'operation on a transport
492
491
# has failed.'
493
492
class PathError(BzrError):
494
 
    
 
493
 
495
494
    _fmt = "Generic path error: %(path)r%(extra)s)"
496
495
 
497
496
    def __init__(self, path, extra=None):
551
550
 
552
551
 
553
552
class ReadingCompleted(InternalBzrError):
554
 
    
 
553
 
555
554
    _fmt = ("The MediumRequest '%(request)s' has already had finish_reading "
556
555
            "called upon it - the request has been completed and no more "
557
556
            "data may be read.")
649
648
 
650
649
 
651
650
class ReadError(PathError):
652
 
    
 
651
 
653
652
    _fmt = """Error reading from %(path)r."""
654
653
 
655
654
 
690
689
 
691
690
# TODO: This is given a URL; we try to unescape it but doing that from inside
692
691
# the exception object is a bit undesirable.
693
 
# TODO: Probably this behavior of should be a common superclass 
 
692
# TODO: Probably this behavior of should be a common superclass
694
693
class NotBranchError(PathError):
695
694
 
696
695
    _fmt = 'Not a branch: "%(path)s".'
765
764
 
766
765
 
767
766
class UnknownFormatError(BzrError):
768
 
    
 
767
 
769
768
    _fmt = "Unknown %(kind)s format: %(format)r"
770
769
 
771
770
    def __init__(self, format, kind='branch'):
774
773
 
775
774
 
776
775
class IncompatibleFormat(BzrError):
777
 
    
 
776
 
778
777
    _fmt = "Format %(format)s is not compatible with .bzr version %(bzrdir)s."
779
778
 
780
779
    def __init__(self, format, bzrdir_format):
797
796
 
798
797
 
799
798
class IncompatibleRevision(BzrError):
800
 
    
 
799
 
801
800
    _fmt = "Revision is not compatible with %(repo_format)s"
802
801
 
803
802
    def __init__(self, repo_format):
1131
1130
 
1132
1131
class NoSuchRevisionInTree(NoSuchRevision):
1133
1132
    """When using Tree.revision_tree, and the revision is not accessible."""
1134
 
    
 
1133
 
1135
1134
    _fmt = "The revision id {%(revision_id)s} is not present in the tree %(tree)s."
1136
1135
 
1137
1136
    def __init__(self, tree, revision_id):
1201
1200
 
1202
1201
 
1203
1202
class NoCommonAncestor(BzrError):
1204
 
    
 
1203
 
1205
1204
    _fmt = "Revisions have no common ancestor: %(revision_a)s %(revision_b)s"
1206
1205
 
1207
1206
    def __init__(self, revision_a, revision_b):
1275
1274
        self.branch = branch
1276
1275
        self.master = master
1277
1276
 
1278
 
        
 
1277
 
1279
1278
class CommitToDoubleBoundBranch(BzrError):
1280
1279
 
1281
1280
    _fmt = ("Cannot commit to branch %(branch)s."
1351
1350
class WeaveParentMismatch(WeaveError):
1352
1351
 
1353
1352
    _fmt = "Parents are mismatched between two revisions. %(message)s"
1354
 
    
 
1353
 
1355
1354
 
1356
1355
class WeaveInvalidChecksum(WeaveError):
1357
1356
 
1383
1382
 
1384
1383
 
1385
1384
class VersionedFileError(BzrError):
1386
 
    
 
1385
 
1387
1386
    _fmt = "Versioned file error"
1388
1387
 
1389
1388
 
1390
1389
class RevisionNotPresent(VersionedFileError):
1391
 
    
 
1390
 
1392
1391
    _fmt = 'Revision {%(revision_id)s} not present in "%(file_id)s".'
1393
1392
 
1394
1393
    def __init__(self, revision_id, file_id):
1398
1397
 
1399
1398
 
1400
1399
class RevisionAlreadyPresent(VersionedFileError):
1401
 
    
 
1400
 
1402
1401
    _fmt = 'Revision {%(revision_id)s} already present in "%(file_id)s".'
1403
1402
 
1404
1403
    def __init__(self, revision_id, file_id):
1413
1412
 
1414
1413
 
1415
1414
class KnitError(InternalBzrError):
1416
 
    
 
1415
 
1417
1416
    _fmt = "Knit error"
1418
1417
 
1419
1418
 
1451
1450
    def __init__(self, stream_format, target_format):
1452
1451
        self.stream_format = stream_format
1453
1452
        self.target_format = target_format
1454
 
        
 
1453
 
1455
1454
 
1456
1455
class KnitDataStreamUnknown(KnitError):
1457
1456
    # Indicates a data stream we don't know how to handle.
1460
1459
 
1461
1460
    def __init__(self, stream_format):
1462
1461
        self.stream_format = stream_format
1463
 
        
 
1462
 
1464
1463
 
1465
1464
class KnitHeaderError(KnitError):
1466
1465
 
1476
1475
 
1477
1476
    Currently only 'fulltext' and 'line-delta' are supported.
1478
1477
    """
1479
 
    
 
1478
 
1480
1479
    _fmt = ("Knit index %(filename)s does not have a known method"
1481
1480
            " in options: %(options)r")
1482
1481
 
1496
1495
 
1497
1496
    internal_error = True
1498
1497
 
1499
 
    _fmt = ("Pack files have changed, reload and retry. %(orig_error)s")
 
1498
    _fmt = ("Pack files have changed, reload and retry. context: %(context)s"
 
1499
            " %(orig_error)s")
1500
1500
 
1501
 
    def __init__(self, reload_occurred, exc_info):
1502
 
        """create a new RestartWithNewPacks error.
 
1501
    def __init__(self, context, reload_occurred, exc_info):
 
1502
        """create a new RetryWithNewPacks error.
1503
1503
 
1504
1504
        :param reload_occurred: Set to True if we know that the packs have
1505
1505
            already been reloaded, and we are failing because of an in-memory
1518
1518
        #       RetryWithNewPacks also not being caught
1519
1519
 
1520
1520
 
 
1521
class RetryAutopack(RetryWithNewPacks):
 
1522
    """Raised when we are autopacking and we find a missing file.
 
1523
 
 
1524
    Meant as a signaling exception, to tell the autopack code it should try
 
1525
    again.
 
1526
    """
 
1527
 
 
1528
    internal_error = True
 
1529
 
 
1530
    _fmt = ("Pack files have changed, reload and try autopack again."
 
1531
            " context: %(context)s %(orig_error)s")
 
1532
 
 
1533
 
1521
1534
class NoSuchExportFormat(BzrError):
1522
 
    
 
1535
 
1523
1536
    _fmt = "Export format %(format)r not supported"
1524
1537
 
1525
1538
    def __init__(self, format):
1528
1541
 
1529
1542
 
1530
1543
class TransportError(BzrError):
1531
 
    
 
1544
 
1532
1545
    _fmt = "Transport error: %(msg)s %(orig_error)s"
1533
1546
 
1534
1547
    def __init__(self, msg=None, orig_error=None):
1579
1592
 
1580
1593
class SmartMessageHandlerError(InternalBzrError):
1581
1594
 
1582
 
    _fmt = "The message handler raised an exception: %(exc_value)s."
 
1595
    _fmt = ("The message handler raised an exception:\n"
 
1596
            "%(traceback_text)s")
1583
1597
 
1584
1598
    def __init__(self, exc_info):
1585
 
        self.exc_type, self.exc_value, self.tb = exc_info
1586
 
        
 
1599
        import traceback
 
1600
        self.exc_type, self.exc_value, self.exc_tb = exc_info
 
1601
        self.exc_info = exc_info
 
1602
        traceback_strings = traceback.format_exception(
 
1603
                self.exc_type, self.exc_value, self.exc_tb)
 
1604
        self.traceback_text = ''.join(traceback_strings)
 
1605
 
1587
1606
 
1588
1607
# A set of semi-meaningful errors which can be thrown
1589
1608
class TransportNotPossible(TransportError):
1661
1680
 
1662
1681
    _fmt = '%(source)s is%(permanently)s redirected to %(target)s'
1663
1682
 
1664
 
    def __init__(self, source, target, is_permanent=False, qual_proto=None):
 
1683
    def __init__(self, source, target, is_permanent=False):
1665
1684
        self.source = source
1666
1685
        self.target = target
1667
1686
        if is_permanent:
1668
1687
            self.permanently = ' permanently'
1669
1688
        else:
1670
1689
            self.permanently = ''
1671
 
        self._qualified_proto = qual_proto
1672
1690
        TransportError.__init__(self)
1673
1691
 
1674
 
    def _requalify_url(self, url):
1675
 
        """Restore the qualified proto in front of the url"""
1676
 
        # When this exception is raised, source and target are in
1677
 
        # user readable format. But some transports may use a
1678
 
        # different proto (http+urllib:// will present http:// to
1679
 
        # the user. If a qualified proto is specified, the code
1680
 
        # trapping the exception can get the qualified urls to
1681
 
        # properly handle the redirection themself (creating a
1682
 
        # new transport object from the target url for example).
1683
 
        # But checking that the scheme of the original and
1684
 
        # redirected urls are the same can be tricky. (see the
1685
 
        # FIXME in BzrDir.open_from_transport for the unique use
1686
 
        # case so far).
1687
 
        if self._qualified_proto is None:
1688
 
            return url
1689
 
 
1690
 
        # The TODO related to NotBranchError mention that doing
1691
 
        # that kind of manipulation on the urls may not be the
1692
 
        # exception object job. On the other hand, this object is
1693
 
        # the interface between the code and the user so
1694
 
        # presenting the urls in different ways is indeed its
1695
 
        # job...
1696
 
        import urlparse
1697
 
        proto, netloc, path, query, fragment = urlparse.urlsplit(url)
1698
 
        return urlparse.urlunsplit((self._qualified_proto, netloc, path,
1699
 
                                   query, fragment))
1700
 
 
1701
 
    def get_source_url(self):
1702
 
        return self._requalify_url(self.source)
1703
 
 
1704
 
    def get_target_url(self):
1705
 
        return self._requalify_url(self.target)
1706
 
 
1707
1692
 
1708
1693
class TooManyRedirections(TransportError):
1709
1694
 
1744
1729
 
1745
1730
class WorkingTreeNotRevision(BzrError):
1746
1731
 
1747
 
    _fmt = ("The working tree for %(basedir)s has changed since" 
 
1732
    _fmt = ("The working tree for %(basedir)s has changed since"
1748
1733
            " the last commit, but weave merge requires that it be"
1749
1734
            " unchanged")
1750
1735
 
2064
2049
    _fmt = """This tree contains left-over files from a failed operation.
2065
2050
    Please examine %(limbo_dir)s to see if it contains any files you wish to
2066
2051
    keep, and delete it when you are done."""
2067
 
    
 
2052
 
2068
2053
    def __init__(self, limbo_dir):
2069
2054
       BzrError.__init__(self)
2070
2055
       self.limbo_dir = limbo_dir
2186
2171
    _fmt = "Cannot perform local-only commits on unbound branches."
2187
2172
 
2188
2173
 
2189
 
class MissingProgressBarFinish(BzrError):
2190
 
 
2191
 
    _fmt = "A nested progress bar was not 'finished' correctly."
2192
 
 
2193
 
 
2194
2174
class InvalidProgressBarType(BzrError):
2195
2175
 
2196
2176
    _fmt = ("Environment variable BZR_PROGRESS_BAR='%(bar_type)s"
2222
2202
 
2223
2203
 
2224
2204
class BinaryFile(BzrError):
2225
 
    
 
2205
 
2226
2206
    _fmt = "File is binary but should be text."
2227
2207
 
2228
2208
 
2248
2228
 
2249
2229
 
2250
2230
class NotABundle(BzrError):
2251
 
    
 
2231
 
2252
2232
    _fmt = "Not a bzr revision-bundle: %(text)r"
2253
2233
 
2254
2234
    def __init__(self, text):
2256
2236
        self.text = text
2257
2237
 
2258
2238
 
2259
 
class BadBundle(BzrError): 
2260
 
    
 
2239
class BadBundle(BzrError):
 
2240
 
2261
2241
    _fmt = "Bad bzr revision-bundle: %(text)r"
2262
2242
 
2263
2243
    def __init__(self, text):
2265
2245
        self.text = text
2266
2246
 
2267
2247
 
2268
 
class MalformedHeader(BadBundle): 
2269
 
    
 
2248
class MalformedHeader(BadBundle):
 
2249
 
2270
2250
    _fmt = "Malformed bzr revision-bundle header: %(text)r"
2271
2251
 
2272
2252
 
2273
 
class MalformedPatches(BadBundle): 
2274
 
    
 
2253
class MalformedPatches(BadBundle):
 
2254
 
2275
2255
    _fmt = "Malformed patches in bzr revision-bundle: %(text)r"
2276
2256
 
2277
2257
 
2278
 
class MalformedFooter(BadBundle): 
2279
 
    
 
2258
class MalformedFooter(BadBundle):
 
2259
 
2280
2260
    _fmt = "Malformed footer in bzr revision-bundle: %(text)r"
2281
2261
 
2282
2262
 
2283
2263
class UnsupportedEOLMarker(BadBundle):
2284
 
    
2285
 
    _fmt = "End of line marker was not \\n in bzr revision-bundle"    
 
2264
 
 
2265
    _fmt = "End of line marker was not \\n in bzr revision-bundle"
2286
2266
 
2287
2267
    def __init__(self):
2288
 
        # XXX: BadBundle's constructor assumes there's explanatory text, 
 
2268
        # XXX: BadBundle's constructor assumes there's explanatory text,
2289
2269
        # but for this there is not
2290
2270
        BzrError.__init__(self)
2291
2271
 
2292
2272
 
2293
2273
class IncompatibleBundleFormat(BzrError):
2294
 
    
 
2274
 
2295
2275
    _fmt = "Bundle format %(bundle_format)s is incompatible with %(other)s"
2296
2276
 
2297
2277
    def __init__(self, bundle_format, other):
2301
2281
 
2302
2282
 
2303
2283
class BadInventoryFormat(BzrError):
2304
 
    
 
2284
 
2305
2285
    _fmt = "Root class for inventory serialization errors"
2306
2286
 
2307
2287
 
2360
2340
        self.revision_id = revision_id
2361
2341
        self.ghost_revision_id = ghost_revision_id
2362
2342
 
2363
 
        
 
2343
 
2364
2344
class GhostRevisionUnusableHere(BzrError):
2365
2345
 
2366
2346
    _fmt = "Ghost revision {%(revision_id)s} cannot be used here."
2458
2438
 
2459
2439
 
2460
2440
class UnsupportedInventoryKind(BzrError):
2461
 
    
 
2441
 
2462
2442
    _fmt = """Unsupported entry kind %(kind)s"""
2463
2443
 
2464
2444
    def __init__(self, kind):
2476
2456
 
2477
2457
 
2478
2458
class SubsumeTargetNeedsUpgrade(BzrError):
2479
 
    
 
2459
 
2480
2460
    _fmt = """Subsume target %(other_tree)s needs to be upgraded."""
2481
2461
 
2482
2462
    def __init__(self, other_tree):
2510
2490
    def __init__(self, branch):
2511
2491
        self.branch = branch
2512
2492
 
2513
 
        
 
2493
 
2514
2494
class TagAlreadyExists(BzrError):
2515
2495
 
2516
2496
    _fmt = "Tag %(tag_name)s already exists."
2599
2579
        """
2600
2580
        self.error_from_smart_server = error_from_smart_server
2601
2581
        self.error_tuple = error_from_smart_server.error_tuple
2602
 
        
 
2582
 
2603
2583
 
2604
2584
class ContainerError(BzrError):
2605
2585
    """Base class of container errors."""
2608
2588
class UnknownContainerFormatError(ContainerError):
2609
2589
 
2610
2590
    _fmt = "Unrecognised container format: %(container_format)r"
2611
 
    
 
2591
 
2612
2592
    def __init__(self, container_format):
2613
2593
        self.container_format = container_format
2614
2594
 
2678
2658
 
2679
2659
class NoMailAddressSpecified(BzrError):
2680
2660
 
2681
 
    _fmt = "No mail-to address specified."
 
2661
    _fmt = "No mail-to address (--mail-to) or output (-o) specified."
2682
2662
 
2683
2663
 
2684
2664
class UnknownMailClient(BzrError):
2764
2744
    _fmt = "'%(display_url)s' is already standalone."
2765
2745
 
2766
2746
 
 
2747
class AlreadyWithTrees(BzrDirError):
 
2748
 
 
2749
    _fmt = ("Shared repository '%(display_url)s' already creates "
 
2750
            "working trees.")
 
2751
 
 
2752
 
 
2753
class AlreadyWithNoTrees(BzrDirError):
 
2754
 
 
2755
    _fmt = ("Shared repository '%(display_url)s' already doesn't create "
 
2756
            "working trees.")
 
2757
 
 
2758
 
2767
2759
class ReconfigurationNotSupported(BzrDirError):
2768
2760
 
2769
2761
    _fmt = "Requested reconfiguration of '%(display_url)s' is not supported."
2823
2815
 
2824
2816
 
2825
2817
class CommandAvailableInPlugin(StandardError):
2826
 
    
 
2818
 
2827
2819
    internal_error = False
2828
2820
 
2829
2821
    def __init__(self, cmd_name, plugin_metadata, provider):
2830
 
        
 
2822
 
2831
2823
        self.plugin_metadata = plugin_metadata
2832
2824
        self.cmd_name = cmd_name
2833
2825
        self.provider = provider
2834
2826
 
2835
2827
    def __str__(self):
2836
2828
 
2837
 
        _fmt = ('"%s" is not a standard bzr command. \n' 
 
2829
        _fmt = ('"%s" is not a standard bzr command. \n'
2838
2830
                'However, the following official plugin provides this command: %s\n'
2839
2831
                'You can install it by going to: %s'
2840
 
                % (self.cmd_name, self.plugin_metadata['name'], 
 
2832
                % (self.cmd_name, self.plugin_metadata['name'],
2841
2833
                    self.plugin_metadata['url']))
2842
2834
 
2843
2835
        return _fmt
2844
2836
 
2845
2837
 
2846
2838
class NoPluginAvailable(BzrError):
2847
 
    pass    
 
2839
    pass
2848
2840
 
2849
2841
 
2850
2842
class NotATerminal(BzrError):
2934
2926
    """A pre_change_branch_tip hook function may raise this to cleanly and
2935
2927
    explicitly abort a change to a branch tip.
2936
2928
    """
2937
 
    
 
2929
 
2938
2930
    _fmt = u"Tip change rejected: %(msg)s"
2939
2931
 
2940
2932
    def __init__(self, msg):
2954
2946
        BzrError.__init__(self, shelf_id=shelf_id)
2955
2947
 
2956
2948
 
 
2949
class InvalidShelfId(BzrError):
 
2950
 
 
2951
    _fmt = '"%(invalid_id)s" is not a valid shelf id, try a number instead.'
 
2952
 
 
2953
    def __init__(self, invalid_id):
 
2954
        BzrError.__init__(self, invalid_id=invalid_id)
 
2955
 
 
2956
 
2957
2957
class UserAbort(BzrError):
2958
2958
 
2959
2959
    _fmt = 'The user aborted the operation.'
 
2960
 
 
2961
 
 
2962
class MustHaveWorkingTree(BzrError):
 
2963
 
 
2964
    _fmt = ("Branching '%(url)s'(%(format)s) must create a working tree.")
 
2965
 
 
2966
    def __init__(self, format, url):
 
2967
        BzrError.__init__(self, format=format, url=url)
 
2968
 
 
2969
 
 
2970
class NoSuchView(BzrError):
 
2971
    """A view does not exist.
 
2972
    """
 
2973
 
 
2974
    _fmt = u"No such view: %(view_name)s."
 
2975
 
 
2976
    def __init__(self, view_name):
 
2977
        self.view_name = view_name
 
2978
 
 
2979
 
 
2980
class ViewsNotSupported(BzrError):
 
2981
    """Views are not supported by a tree format.
 
2982
    """
 
2983
 
 
2984
    _fmt = ("Views are not supported by %(tree)s;"
 
2985
            " use 'bzr upgrade' to change your tree to a later format.")
 
2986
 
 
2987
    def __init__(self, tree):
 
2988
        self.tree = tree
 
2989
 
 
2990
 
 
2991
class FileOutsideView(BzrError):
 
2992
 
 
2993
    _fmt = ('Specified file "%(file_name)s" is outside the current view: '
 
2994
            '%(view_str)s')
 
2995
 
 
2996
    def __init__(self, file_name, view_files):
 
2997
        self.file_name = file_name
 
2998
        self.view_str = ", ".join(view_files)
 
2999
 
 
3000
 
 
3001
class UnresumableWriteGroup(BzrError):
 
3002
 
 
3003
    _fmt = ("Repository %(repository)s cannot resume write group "
 
3004
            "%(write_groups)r: %(reason)s")
 
3005
 
 
3006
    internal_error = True
 
3007
 
 
3008
    def __init__(self, repository, write_groups, reason):
 
3009
        self.repository = repository
 
3010
        self.write_groups = write_groups
 
3011
        self.reason = reason
 
3012
 
 
3013
 
 
3014
class UnsuspendableWriteGroup(BzrError):
 
3015
 
 
3016
    _fmt = ("Repository %(repository)s cannot suspend a write group.")
 
3017
 
 
3018
    internal_error = True
 
3019
 
 
3020
    def __init__(self, repository):
 
3021
        self.repository = repository