/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 from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
167
167
 
168
168
class InvalidRevisionId(BzrNewError):
169
169
    """Invalid revision-id {%(revision_id)s} in %(branch)s"""
 
170
 
170
171
    def __init__(self, revision_id, branch):
171
172
        # branch can be any string or object with __str__ defined
172
173
        BzrNewError.__init__(self)
174
175
        self.branch = branch
175
176
 
176
177
 
 
178
class NoSuchId(BzrNewError):
 
179
    """The file id %(file_id)s is not present in the tree %(tree)s."""
 
180
    
 
181
    def __init__(self, tree, file_id):
 
182
        BzrNewError.__init__(self)
 
183
        self.file_id = file_id
 
184
        self.tree = tree
 
185
 
 
186
 
177
187
class NoWorkingTree(BzrNewError):
178
188
    """No WorkingTree exists for %(base)s."""
179
189
    
505
515
        self.format = format
506
516
 
507
517
 
508
 
 
509
518
class StrictCommitFailed(Exception):
510
519
    """Commit refused because there are unknowns in the tree."""
511
520
 
516
525
    is_user_error = False
517
526
 
518
527
    def __init__(self, branch, revision):
519
 
        self.branch = branch
520
 
        self.revision = revision
 
528
        BzrNewError.__init__(self, branch=branch, revision=revision)
 
529
 
 
530
 
 
531
class NoSuchRevisionSpec(BzrNewError):
 
532
    """No namespace registered for string: %(spec)r"""
 
533
 
 
534
    def __init__(self, spec):
 
535
        BzrNewError.__init__(self, spec=spec)
 
536
 
 
537
 
 
538
class InvalidRevisionSpec(BzrNewError):
 
539
    """Requested revision: '%(spec)s' does not exist in branch:
 
540
%(branch)s%(extra)s"""
 
541
 
 
542
    def __init__(self, spec, branch, extra=None):
 
543
        BzrNewError.__init__(self, branch=branch, spec=spec)
 
544
        if extra:
 
545
            self.extra = '\n' + str(extra)
 
546
        else:
 
547
            self.extra = ''
521
548
 
522
549
 
523
550
class HistoryMissing(BzrError):
586
613
        self.bases = bases
587
614
 
588
615
 
589
 
class NoCommits(BzrError):
 
616
class NoCommits(BzrNewError):
 
617
    """Branch %(branch)s has no commits."""
 
618
 
590
619
    def __init__(self, branch):
591
 
        msg = "Branch %s has no commits." % branch
592
 
        BzrError.__init__(self, msg)
 
620
        BzrNewError.__init__(self, branch=branch)
593
621
 
594
622
 
595
623
class UnlistableStore(BzrError):
777
805
 
778
806
 
779
807
class InvalidRange(TransportError):
780
 
    """Invalid range access."""
 
808
    """Invalid range access in %(path)s at %(offset)s."""
781
809
    
782
810
    def __init__(self, path, offset):
783
811
        TransportError.__init__(self, ("Invalid range access in %s at %d"
784
812
                                       % (path, offset)))
 
813
        self.path = path
 
814
        self.offset = offset
785
815
 
786
816
 
787
817
class InvalidHttpResponse(TransportError):
949
979
        DependencyNotPresent.__init__(self, 'paramiko', error)
950
980
 
951
981
 
 
982
class PointlessMerge(BzrNewError):
 
983
    """Nothing to merge."""
 
984
 
 
985
 
952
986
class UninitializableFormat(BzrNewError):
953
987
    """Format %(format)s cannot be initialised by this version of bzr."""
954
988
 
1112
1146
    """End of line marker was not \\n in bzr revision-bundle"""    
1113
1147
 
1114
1148
    def __init__(self):
1115
 
        BzrNewError.__init__(self)    
 
1149
        BzrNewError.__init__(self)
1116
1150
 
1117
1151
 
1118
1152
class UnknownSSH(BzrNewError):
1122
1156
        BzrNewError.__init__(self)
1123
1157
        self.vendor = vendor
1124
1158
 
 
1159
 
 
1160
class GhostRevisionUnusableHere(BzrNewError):
 
1161
    """Ghost revision {%(revision_id)s} cannot be used here."""
 
1162
 
 
1163
    def __init__(self, revision_id):
 
1164
        BzrNewError.__init__(self)
 
1165
        self.revision_id = revision_id