/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/hooks.py

  • Committer: Robert Collins
  • Date: 2010-05-06 11:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506110810-h3j07fh5gmw54s25
Cleaner matcher matching revised unlocking protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2007-2010 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
18
18
"""Support for plugin hooking logic."""
19
19
from bzrlib import registry
20
20
from bzrlib.lazy_import import lazy_import
21
 
from bzrlib.symbol_versioning import deprecated_method
22
21
lazy_import(globals(), """
23
22
import textwrap
24
23
 
45
44
    'bzrlib.info', 'InfoHooks')
46
45
known_hooks.register_lazy(('bzrlib.lock', 'Lock.hooks'), 'bzrlib.lock',
47
46
    'LockHooks')
 
47
known_hooks.register_lazy(('bzrlib.merge', 'Merger.hooks'), 'bzrlib.merge',
 
48
    'MergeHooks')
48
49
known_hooks.register_lazy(('bzrlib.msgeditor', 'hooks'), 'bzrlib.msgeditor',
49
50
    'MessageEditorHooks')
50
51
known_hooks.register_lazy(('bzrlib.mutabletree', 'MutableTree.hooks'),
56
57
known_hooks.register_lazy(
57
58
    ('bzrlib.version_info_formats.format_rio', 'RioVersionInfoBuilder.hooks'),
58
59
    'bzrlib.version_info_formats.format_rio', 'RioVersionInfoBuilderHooks')
 
60
known_hooks.register_lazy(
 
61
    ('bzrlib.merge_directive', 'BaseMergeDirective.hooks'),
 
62
    'bzrlib.merge_directive', 'MergeDirectiveHooks')
59
63
 
60
64
 
61
65
def known_hooks_key_to_object((module_name, member_name)):
178
182
    :ivar introduced: A version tuple specifying what version the hook was
179
183
        introduced in. None indicates an unknown version.
180
184
    :ivar deprecated: A version tuple specifying what version the hook was
181
 
        deprecated or superceded in. None indicates that the hook is not
182
 
        superceded or deprecated. If the hook is superceded then the doc
 
185
        deprecated or superseded in. None indicates that the hook is not
 
186
        superseded or deprecated. If the hook is superseded then the doc
183
187
        should describe the recommended replacement hook to register for.
184
188
    :ivar doc: The docs for using the hook.
185
189
    """
216
220
        strings.append('Introduced in: %s' % introduced_string)
217
221
        if self.deprecated:
218
222
            deprecated_string = _format_version_tuple(self.deprecated)
219
 
        else:
220
 
            deprecated_string = 'Not deprecated'
221
 
        strings.append('Deprecated in: %s' % deprecated_string)
 
223
            strings.append('Deprecated in: %s' % deprecated_string)
222
224
        strings.append('')
223
 
        strings.extend(textwrap.wrap(self.__doc__))
 
225
        strings.extend(textwrap.wrap(self.__doc__,
 
226
            break_long_words=False))
224
227
        strings.append('')
225
228
        return '\n'.join(strings)
226
229
 
275
278
 
276
279
See `Using hooks`_ in the User Guide for examples.
277
280
 
278
 
.. _Using hooks: ../user-guide/index.html#using-hooks
 
281
.. _Using hooks: ../user-guide/hooks.html
279
282
 
280
283
The class that contains each hook is given before the hooks it supplies. For
281
284
instance, BranchHooks as the class is the hooks class for