~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Andrew Bennetts
  • Date: 2010-01-13 23:16:20 UTC
  • mfrom: (4957 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4960.
  • Revision ID: andrew.bennetts@canonical.com-20100113231620-n6in2yjib2v6z03g
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1247
1247
class AmbiguousBase(BzrError):
1248
1248
 
1249
1249
    def __init__(self, bases):
1250
 
        warn("BzrError AmbiguousBase has been deprecated as of bzrlib 0.8.",
1251
 
                DeprecationWarning)
 
1250
        symbol_versioning.warn("BzrError AmbiguousBase has been deprecated "
 
1251
            "as of bzrlib 0.8.", DeprecationWarning, stacklevel=2)
1252
1252
        msg = ("The correct base is unclear, because %s are all equally close"
1253
1253
                % ", ".join(bases))
1254
1254
        BzrError.__init__(self, msg)
2942
2942
class HookFailed(BzrError):
2943
2943
    """Raised when a pre_change_branch_tip hook function fails anything other
2944
2944
    than TipChangeRejected.
 
2945
 
 
2946
    Note that this exception is no longer raised, and the import is only left
 
2947
    to be nice to code which might catch it in a plugin.
2945
2948
    """
2946
2949
 
2947
2950
    _fmt = ("Hook '%(hook_name)s' during %(hook_stage)s failed:\n"
2948
2951
            "%(traceback_text)s%(exc_value)s")
2949
2952
 
2950
 
    def __init__(self, hook_stage, hook_name, exc_info):
 
2953
    def __init__(self, hook_stage, hook_name, exc_info, warn=True):
 
2954
        if warn:
 
2955
            symbol_versioning.warn("BzrError HookFailed has been deprecated "
 
2956
                "as of bzrlib 2.1.", DeprecationWarning, stacklevel=2)
2951
2957
        import traceback
2952
2958
        self.hook_stage = hook_stage
2953
2959
        self.hook_name = hook_name