/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

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
256
256
 
257
257
class NoSuchId(BzrError):
258
258
 
259
 
    _fmt = "The file id %(file_id)s is not present in the tree %(tree)s."
 
259
    _fmt = 'The file id "%(file_id)s" is not present in the tree %(tree)s.'
260
260
    
261
261
    def __init__(self, tree, file_id):
262
262
        BzrError.__init__(self)
266
266
 
267
267
class NoSuchIdInRepository(NoSuchId):
268
268
 
269
 
    _fmt = ("The file id %(file_id)r is not present in the repository"
270
 
            " %(repository)r")
 
269
    _fmt = ('The file id "%(file_id)s" is not present in the repository'
 
270
            ' %(repository)r')
271
271
 
272
272
    def __init__(self, repository, file_id):
273
273
        BzrError.__init__(self, repository=repository, file_id=file_id)
286
286
 
287
287
class NoWorkingTree(BzrError):
288
288
 
289
 
    _fmt = "No WorkingTree exists for %(base)s."
 
289
    _fmt = 'No WorkingTree exists for "%(base)s".'
290
290
    
291
291
    def __init__(self, base):
292
292
        BzrError.__init__(self)
308
308
 
309
309
class WorkingTreeAlreadyPopulated(BzrError):
310
310
 
311
 
    _fmt = """Working tree already populated in %(base)s"""
 
311
    _fmt = 'Working tree already populated in "%(base)s"'
312
312
 
313
313
    internal_error = True
314
314
 
468
468
 
469
469
class NotADirectory(PathError):
470
470
 
471
 
    _fmt = "%(path)r is not a directory %(extra)s"
 
471
    _fmt = '"%(path)s" is not a directory %(extra)s'
472
472
 
473
473
 
474
474
class NotInWorkingDirectory(PathError):
475
475
 
476
 
    _fmt = "%(path)r is not in the working directory %(extra)s"
 
476
    _fmt = '"%(path)s" is not in the working directory %(extra)s'
477
477
 
478
478
 
479
479
class DirectoryNotEmpty(PathError):
480
480
 
481
 
    _fmt = "Directory not empty: %(path)r%(extra)s"
 
481
    _fmt = 'Directory not empty: "%(path)s"%(extra)s'
482
482
 
483
483
 
484
484
class ReadingCompleted(BzrError):
495
495
 
496
496
class ResourceBusy(PathError):
497
497
 
498
 
    _fmt = "Device or resource busy: %(path)r%(extra)s"
 
498
    _fmt = 'Device or resource busy: "%(path)s"%(extra)s'
499
499
 
500
500
 
501
501
class PermissionDenied(PathError):
502
502
 
503
 
    _fmt = "Permission denied: %(path)r%(extra)s"
 
503
    _fmt = 'Permission denied: "%(path)s"%(extra)s'
504
504
 
505
505
 
506
506
class InvalidURL(PathError):
507
507
 
508
 
    _fmt = "Invalid url supplied to transport: %(path)r%(extra)s"
 
508
    _fmt = 'Invalid url supplied to transport: "%(path)s"%(extra)s'
509
509
 
510
510
 
511
511
class InvalidURLJoin(PathError):
512
512
 
513
 
    _fmt = "Invalid URL join request: %(args)s%(extra)s"
 
513
    _fmt = 'Invalid URL join request: "%(args)s"%(extra)s'
514
514
 
515
515
    def __init__(self, msg, base, args):
516
516
        PathError.__init__(self, base, msg)
542
542
 
543
543
class ShortReadvError(PathError):
544
544
 
545
 
    _fmt = ("readv() read %(actual)s bytes rather than %(length)s bytes"
546
 
            " at %(offset)s for %(path)s%(extra)s")
 
545
    _fmt = ('readv() read %(actual)s bytes rather than %(length)s bytes'
 
546
            ' at %(offset)s for "%(path)s"%(extra)s')
547
547
 
548
548
    internal_error = True
549
549
 
556
556
 
557
557
class PathNotChild(PathError):
558
558
 
559
 
    _fmt = "Path %(path)r is not a child of path %(base)r%(extra)s"
 
559
    _fmt = 'Path "%(path)s" is not a child of path "%(base)s"%(extra)s'
560
560
 
561
561
    internal_error = True
562
562
 
572
572
 
573
573
class InvalidNormalization(PathError):
574
574
 
575
 
    _fmt = "Path %(path)r is not unicode normalized"
 
575
    _fmt = 'Path "%(path)s" is not unicode normalized'
576
576
 
577
577
 
578
578
# TODO: This is given a URL; we try to unescape it but doing that from inside
580
580
# TODO: Probably this behavior of should be a common superclass 
581
581
class NotBranchError(PathError):
582
582
 
583
 
    _fmt = "Not a branch: %(path)s"
 
583
    _fmt = 'Not a branch: "%(path)s".'
584
584
 
585
585
    def __init__(self, path):
586
586
       import bzrlib.urlutils as urlutils
598
598
 
599
599
class AlreadyBranchError(PathError):
600
600
 
601
 
    _fmt = "Already a branch: %(path)s."
 
601
    _fmt = 'Already a branch: "%(path)s".'
602
602
 
603
603
 
604
604
class BranchExistsWithoutWorkingTree(PathError):
605
605
 
606
 
    _fmt = "Directory contains a branch, but no working tree \
607
 
(use bzr checkout if you wish to build a working tree): %(path)s"
 
606
    _fmt = 'Directory contains a branch, but no working tree \
 
607
(use bzr checkout if you wish to build a working tree): "%(path)s"'
608
608
 
609
609
 
610
610
class AtomicFileAlreadyClosed(PathError):
611
611
 
612
 
    _fmt = ("'%(function)s' called on an AtomicFile after it was closed:"
613
 
            " %(path)s")
 
612
    _fmt = ('"%(function)s" called on an AtomicFile after it was closed:'
 
613
            ' "%(path)s"')
614
614
 
615
615
    def __init__(self, path, function):
616
616
        PathError.__init__(self, path=path, extra=None)
619
619
 
620
620
class InaccessibleParent(PathError):
621
621
 
622
 
    _fmt = ("Parent not accessible given base %(base)s and"
623
 
            " relative path %(path)s")
 
622
    _fmt = ('Parent not accessible given base "%(base)s" and'
 
623
            ' relative path "%(path)s"')
624
624
 
625
625
    def __init__(self, path, base):
626
626
        PathError.__init__(self, path)
629
629
 
630
630
class NoRepositoryPresent(BzrError):
631
631
 
632
 
    _fmt = "No repository present: %(path)r"
 
632
    _fmt = 'No repository present: "%(path)s"'
633
633
    def __init__(self, bzrdir):
634
634
        BzrError.__init__(self)
635
635
        self.path = bzrdir.transport.clone('..').base
637
637
 
638
638
class FileInWrongBranch(BzrError):
639
639
 
640
 
    _fmt = "File %(path)s in not in branch %(branch_base)s."
 
640
    _fmt = 'File "%(path)s" in not in branch %(branch_base)s.'
641
641
 
642
642
    def __init__(self, branch, path):
643
643
        BzrError.__init__(self)
687
687
class AlreadyVersionedError(BzrError):
688
688
    """Used when a path is expected not to be versioned, but it is."""
689
689
 
690
 
    _fmt = "%(context_info)s%(path)s is already versioned"
 
690
    _fmt = "%(context_info)s%(path)s is already versioned."
691
691
 
692
692
    def __init__(self, path, context_info=None):
693
693
        """Construct a new AlreadyVersionedError.
708
708
class NotVersionedError(BzrError):
709
709
    """Used when a path is expected to be versioned, but it is not."""
710
710
 
711
 
    _fmt = "%(context_info)s%(path)s is not versioned"
 
711
    _fmt = "%(context_info)s%(path)s is not versioned."
712
712
 
713
713
    def __init__(self, path, context_info=None):
714
714
        """Construct a new NotVersionedError.
767
767
 
768
768
class ForbiddenControlFileError(BzrError):
769
769
 
770
 
    _fmt = "Cannot operate on %(filename)s because it is a control file"
 
770
    _fmt = 'Cannot operate on "%(filename)s" because it is a control file'
771
771
 
772
772
 
773
773
class LockError(BzrError):
870
870
 
871
871
class LockContention(LockError):
872
872
 
873
 
    _fmt = "Could not acquire lock %(lock)s"
 
873
    _fmt = 'Could not acquire lock "%(lock)s"'
874
874
    # TODO: show full url for lock, combining the transport and relative
875
875
    # bits?
876
876
 
950
950
        BzrError.__init__(self, files=files, files_str=files_str)
951
951
 
952
952
 
 
953
class BadCommitMessageEncoding(BzrError):
 
954
 
 
955
    _fmt = 'The specified commit message contains characters unsupported by '\
 
956
        'the current encoding.'
 
957
 
 
958
 
953
959
class UpgradeReadonly(BzrError):
954
960
 
955
961
    _fmt = "Upgrade URL cannot work with readonly URLs."
1005
1011
class NoSuchRevisionInTree(NoSuchRevision):
1006
1012
    """When using Tree.revision_tree, and the revision is not accessible."""
1007
1013
    
1008
 
    _fmt = "The revision id %(revision_id)s is not present in the tree %(tree)s."
 
1014
    _fmt = "The revision id {%(revision_id)s} is not present in the tree %(tree)s."
1009
1015
 
1010
1016
    def __init__(self, tree, revision_id):
1011
1017
        BzrError.__init__(self)
1143
1149
 
1144
1150
class BoundBranchOutOfDate(BzrError):
1145
1151
 
1146
 
    _fmt = ("Bound branch %(branch)s is out of date"
1147
 
            " with master branch %(master)s.")
 
1152
    _fmt = ("Bound branch %(branch)s is out of date with master branch"
 
1153
            " %(master)s.")
1148
1154
 
1149
1155
    def __init__(self, branch, master):
1150
1156
        BzrError.__init__(self)
1265
1271
 
1266
1272
class RevisionNotPresent(VersionedFileError):
1267
1273
    
1268
 
    _fmt = "Revision {%(revision_id)s} not present in %(file_id)s."
 
1274
    _fmt = 'Revision {%(revision_id)s} not present in "%(file_id)s".'
1269
1275
 
1270
1276
    def __init__(self, revision_id, file_id):
1271
1277
        VersionedFileError.__init__(self)
1275
1281
 
1276
1282
class RevisionAlreadyPresent(VersionedFileError):
1277
1283
    
1278
 
    _fmt = "Revision {%(revision_id)s} already present in %(file_id)s."
 
1284
    _fmt = 'Revision {%(revision_id)s} already present in "%(file_id)s".'
1279
1285
 
1280
1286
    def __init__(self, revision_id, file_id):
1281
1287
        VersionedFileError.__init__(self)
1297
1303
 
1298
1304
class KnitHeaderError(KnitError):
1299
1305
 
1300
 
    _fmt = "Knit header error: %(badline)r unexpected for file %(filename)s"
 
1306
    _fmt = 'Knit header error: %(badline)r unexpected for file "%(filename)s".'
1301
1307
 
1302
1308
    def __init__(self, badline, filename):
1303
1309
        KnitError.__init__(self)
1527
1533
 
1528
1534
class SigningFailed(BzrError):
1529
1535
 
1530
 
    _fmt = "Failed to gpg sign data with command %(command_line)r"
 
1536
    _fmt = 'Failed to gpg sign data with command "%(command_line)s"'
1531
1537
 
1532
1538
    def __init__(self, command_line):
1533
1539
        BzrError.__init__(self, command_line=command_line)
1607
1613
 
1608
1614
class NoBundleFound(BzrError):
1609
1615
 
1610
 
    _fmt = "No bundle was found in %(filename)s"
 
1616
    _fmt = 'No bundle was found in "%(filename)s".'
1611
1617
 
1612
1618
    def __init__(self, filename):
1613
1619
        BzrError.__init__(self)
1636
1642
        self.text_revision = text_revision
1637
1643
        self.file_id = file_id
1638
1644
 
 
1645
 
1639
1646
class DuplicateFileId(BzrError):
1640
1647
 
1641
1648
    _fmt = "File id {%(file_id)s} already exists in inventory as %(entry)s"
1844
1851
       self.limbo_dir = limbo_dir
1845
1852
 
1846
1853
 
 
1854
class ExistingPendingDeletion(BzrError):
 
1855
 
 
1856
    _fmt = """This tree contains left-over files from a failed operation.
 
1857
    Please examine %(pending_deletion)s to see if it contains any files you
 
1858
    wish to keep, and delete it when you are done."""
 
1859
 
 
1860
    def __init__(self, pending_deletion):
 
1861
       BzrError.__init__(self, pending_deletion=pending_deletion)
 
1862
 
 
1863
 
1847
1864
class ImmortalLimbo(BzrError):
1848
1865
 
1849
1866
    _fmt = """Unable to delete transform temporary directory $(limbo_dir)s.
1855
1872
       self.limbo_dir = limbo_dir
1856
1873
 
1857
1874
 
 
1875
class ImmortalPendingDeletion(BzrError):
 
1876
 
 
1877
    _fmt = """Unable to delete transform temporary directory
 
1878
    %(pending_deletion)s.  Please examine %(pending_deletions)s to see if it
 
1879
    contains any files you wish to keep, and delete it when you are done."""
 
1880
 
 
1881
    def __init__(self, pending_deletion):
 
1882
       BzrError.__init__(self, pending_deletion=pending_deletion)
 
1883
 
 
1884
 
1858
1885
class OutOfDateTree(BzrError):
1859
1886
 
1860
1887
    _fmt = "Working tree is out of date, please run 'bzr update'."
2175
2202
 
2176
2203
class BadSubsumeSource(BzrError):
2177
2204
 
2178
 
    _fmt = """Can't subsume %(other_tree)s into %(tree)s.  %(reason)s"""
 
2205
    _fmt = "Can't subsume %(other_tree)s into %(tree)s. %(reason)s"
2179
2206
 
2180
2207
    def __init__(self, tree, other_tree, reason):
2181
2208
        self.tree = tree
2193
2220
 
2194
2221
class BadReferenceTarget(BzrError):
2195
2222
 
2196
 
    _fmt = "Can't add reference to %(other_tree)s into %(tree)s.  %(reason)s"
 
2223
    _fmt = "Can't add reference to %(other_tree)s into %(tree)s." \
 
2224
           "%(reason)s"
2197
2225
 
2198
2226
    internal_error = True
2199
2227
 
2300
2328
 
2301
2329
class DuplicateRecordNameError(ContainerError):
2302
2330
 
2303
 
    _fmt = "Container has multiple records with the same name: \"%(name)s\""
 
2331
    _fmt = "Container has multiple records with the same name: %(name)s"
2304
2332
 
2305
2333
    def __init__(self, name):
2306
2334
        self.name = name