~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Andrew Bennetts
  • Date: 2010-01-12 02:48:41 UTC
  • mfrom: (4948 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4965.
  • Revision ID: andrew.bennetts@canonical.com-20100112024841-vbudg5ayivfzcwok
Merge lp:bzr, resolving NEWS conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1268
1268
class AmbiguousBase(BzrError):
1269
1269
 
1270
1270
    def __init__(self, bases):
1271
 
        warn("BzrError AmbiguousBase has been deprecated as of bzrlib 0.8.",
1272
 
                DeprecationWarning)
 
1271
        symbol_versioning.warn("BzrError AmbiguousBase has been deprecated "
 
1272
            "as of bzrlib 0.8.", DeprecationWarning, stacklevel=2)
1273
1273
        msg = ("The correct base is unclear, because %s are all equally close"
1274
1274
                % ", ".join(bases))
1275
1275
        BzrError.__init__(self, msg)
2963
2963
class HookFailed(BzrError):
2964
2964
    """Raised when a pre_change_branch_tip hook function fails anything other
2965
2965
    than TipChangeRejected.
 
2966
 
 
2967
    Note that this exception is no longer raised, and the import is only left
 
2968
    to be nice to code which might catch it in a plugin.
2966
2969
    """
2967
2970
 
2968
2971
    _fmt = ("Hook '%(hook_name)s' during %(hook_stage)s failed:\n"
2969
2972
            "%(traceback_text)s%(exc_value)s")
2970
2973
 
2971
 
    def __init__(self, hook_stage, hook_name, exc_info):
 
2974
    def __init__(self, hook_stage, hook_name, exc_info, warn=True):
 
2975
        if warn:
 
2976
            symbol_versioning.warn("BzrError HookFailed has been deprecated "
 
2977
                "as of bzrlib 2.1.", DeprecationWarning, stacklevel=2)
2972
2978
        import traceback
2973
2979
        self.hook_stage = hook_stage
2974
2980
        self.hook_name = hook_name