~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-01 08:02:42 UTC
  • mfrom: (5390.3.3 faster-revert-593560)
  • Revision ID: pqm@pqm.ubuntu.com-20100901080242-esg62ody4frwmy66
(spiv) Avoid repeatedly calling self.target.all_file_ids() in
 InterTree.iter_changes. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
680
680
 
681
681
    _fmt = 'Path "%(path)s" is not a child of path "%(base)s"%(extra)s'
682
682
 
683
 
    internal_error = True
 
683
    internal_error = False
684
684
 
685
685
    def __init__(self, path, base, extra=None):
686
686
        BzrError.__init__(self)
782
782
 
783
783
    _fmt = 'File "%(path)s" is not in branch %(branch_base)s.'
784
784
 
 
785
    # use PathNotChild instead
 
786
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 3, 0)))
785
787
    def __init__(self, branch, path):
786
788
        BzrError.__init__(self)
787
789
        self.branch = branch
1175
1177
class InvalidRevisionSpec(BzrError):
1176
1178
 
1177
1179
    _fmt = ("Requested revision: '%(spec)s' does not exist in branch:"
1178
 
            " %(branch)s%(extra)s")
 
1180
            " %(branch_url)s%(extra)s")
1179
1181
 
1180
1182
    def __init__(self, spec, branch, extra=None):
1181
1183
        BzrError.__init__(self, branch=branch, spec=spec)
 
1184
        self.branch_url = getattr(branch, 'user_url', str(branch))
1182
1185
        if extra:
1183
1186
            self.extra = '\n' + str(extra)
1184
1187
        else:
1981
1984
        "Use --keep to not delete them, or --force to delete them regardless.")
1982
1985
 
1983
1986
    def __init__(self, tree_delta):
 
1987
        symbol_versioning.warn(symbol_versioning.deprecated_in((2, 3, 0)) %
 
1988
            "BzrRemoveChangedFilesError", DeprecationWarning, stacklevel=2)
1984
1989
        BzrError.__init__(self)
1985
1990
        self.changes_as_text = tree_delta.get_changes_as_text()
1986
1991
        #self.paths_as_string = '\n'.join(changed_files)
2840
2845
        else:
2841
2846
            more = ' ' + more
2842
2847
        import bzrlib.urlutils as urlutils
2843
 
        display_url = urlutils.unescape_for_display(
2844
 
            tree.user_url, 'ascii')
 
2848
        user_url = getattr(tree, "user_url", None)
 
2849
        if user_url is None:
 
2850
            display_url = str(tree)
 
2851
        else:
 
2852
            display_url = urlutils.unescape_for_display(user_url, 'ascii')
2845
2853
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2846
2854
 
2847
2855