~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Andrew Bennetts
  • Date: 2010-01-15 03:58:20 UTC
  • mfrom: (4963 +trunk)
  • mto: (4973.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4975.
  • Revision ID: andrew.bennetts@canonical.com-20100115035820-ilb3t36swgzq6v1l
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
3075
3081
    def __init__(self, source_branch, target_branch):
3076
3082
        self.source_branch = source_branch
3077
3083
        self.target_branch = target_branch
 
3084
 
 
3085
 
 
3086
class NoRoundtrippingSupport(BzrError):
 
3087
 
 
3088
    _fmt = ("Roundtripping is not supported between %(source_branch)r and "
 
3089
            "%(target_branch)r.")
 
3090
 
 
3091
    internal_error = True
 
3092
 
 
3093
    def __init__(self, source_branch, target_branch):
 
3094
        self.source_branch = source_branch
 
3095
        self.target_branch = target_branch