/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: Andrew Bennetts
  • Date: 2010-01-11 05:58:22 UTC
  • mto: This revision was merged to the branch mainline in revision 4965.
  • Revision ID: andrew.bennetts@canonical.com-20100111055822-npdkf88i86i1g54h
Fix HPSS tests; pass 'location is a repository' message via smart server when possible (adds BzrDir.open_branchV3 verb).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1179
1179
 
1180
1180
class InvalidRevisionSpec(BzrError):
1181
1181
 
1182
 
    _fmt = ("Requested revision: '%(spec)s' does not exist in branch:"
 
1182
    _fmt = ("Requested revision: %(spec)r does not exist in branch:"
1183
1183
            " %(branch)s%(extra)s")
1184
1184
 
1185
1185
    def __init__(self, spec, branch, extra=None):
1268
1268
class AmbiguousBase(BzrError):
1269
1269
 
1270
1270
    def __init__(self, bases):
1271
 
        symbol_versioning.warn("BzrError AmbiguousBase has been deprecated "
1272
 
            "as of bzrlib 0.8.", DeprecationWarning, stacklevel=2)
 
1271
        warn("BzrError AmbiguousBase has been deprecated as of bzrlib 0.8.",
 
1272
                DeprecationWarning)
1273
1273
        msg = ("The correct base is unclear, because %s are all equally close"
1274
1274
                % ", ".join(bases))
1275
1275
        BzrError.__init__(self, msg)
1297
1297
class BoundBranchOutOfDate(BzrError):
1298
1298
 
1299
1299
    _fmt = ("Bound branch %(branch)s is out of date with master branch"
1300
 
            " %(master)s.%(extra_help)s")
 
1300
            " %(master)s.")
1301
1301
 
1302
1302
    def __init__(self, branch, master):
1303
1303
        BzrError.__init__(self)
1304
1304
        self.branch = branch
1305
1305
        self.master = master
1306
 
        self.extra_help = ''
1307
1306
 
1308
1307
 
1309
1308
class CommitToDoubleBoundBranch(BzrError):
2176
2175
 
2177
2176
    def __init__(self, repo):
2178
2177
        BzrError.__init__(self)
2179
 
        self.repo_path = repo.user_url
 
2178
        self.repo_path = repo.bzrdir.root_transport.base
2180
2179
 
2181
2180
 
2182
2181
class InconsistentDelta(BzrError):
2754
2753
 
2755
2754
    def __init__(self, bzrdir):
2756
2755
        import bzrlib.urlutils as urlutils
2757
 
        display_url = urlutils.unescape_for_display(bzrdir.user_url,
 
2756
        display_url = urlutils.unescape_for_display(bzrdir.root_transport.base,
2758
2757
                                                    'ascii')
2759
2758
        BzrError.__init__(self, bzrdir=bzrdir, display_url=display_url)
2760
2759
 
2835
2834
            more = ' ' + more
2836
2835
        import bzrlib.urlutils as urlutils
2837
2836
        display_url = urlutils.unescape_for_display(
2838
 
            tree.user_url, 'ascii')
 
2837
            tree.bzrdir.root_transport.base, 'ascii')
2839
2838
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2840
2839
 
2841
2840
 
2964
2963
class HookFailed(BzrError):
2965
2964
    """Raised when a pre_change_branch_tip hook function fails anything other
2966
2965
    than TipChangeRejected.
2967
 
 
2968
 
    Note that this exception is no longer raised, and the import is only left
2969
 
    to be nice to code which might catch it in a plugin.
2970
2966
    """
2971
2967
 
2972
2968
    _fmt = ("Hook '%(hook_name)s' during %(hook_stage)s failed:\n"
2973
2969
            "%(traceback_text)s%(exc_value)s")
2974
2970
 
2975
 
    def __init__(self, hook_stage, hook_name, exc_info, warn=True):
2976
 
        if warn:
2977
 
            symbol_versioning.warn("BzrError HookFailed has been deprecated "
2978
 
                "as of bzrlib 2.1.", DeprecationWarning, stacklevel=2)
 
2971
    def __init__(self, hook_stage, hook_name, exc_info):
2979
2972
        import traceback
2980
2973
        self.hook_stage = hook_stage
2981
2974
        self.hook_name = hook_name
3115
3108
    def __init__(self, source_branch, target_branch):
3116
3109
        self.source_branch = source_branch
3117
3110
        self.target_branch = target_branch
3118
 
 
3119
 
 
3120
 
class FileTimestampUnavailable(BzrError):
3121
 
 
3122
 
    _fmt = "The filestamp for %(path)s is not available."
3123
 
 
3124
 
    internal_error = True
3125
 
 
3126
 
    def __init__(self, path):
3127
 
        self.path = path
3128
 
 
3129
 
 
3130
 
class NoColocatedBranchSupport(BzrError):
3131
 
 
3132
 
    _fmt = ("%(bzrdir)r does not support co-located branches.")
3133
 
 
3134
 
    def __init__(self, bzrdir):
3135
 
        self.bzrdir = bzrdir
3136