~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/hooks.py

  • Committer: Robert Collins
  • Date: 2009-04-27 03:27:46 UTC
  • mto: This revision was merged to the branch mainline in revision 4304.
  • Revision ID: robertc@robertcollins.net-20090427032746-vqmcsfbsbvbm04sk
Fixup tests broken by cleaning up the layering.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    'BzrDirHooks')
42
42
known_hooks.register_lazy(('bzrlib.commands', 'Command.hooks'),
43
43
    'bzrlib.commands', 'CommandHooks')
44
 
known_hooks.register_lazy(('bzrlib.info', 'hooks'),
45
 
    'bzrlib.info', 'InfoHooks')
46
44
known_hooks.register_lazy(('bzrlib.lock', 'Lock.hooks'), 'bzrlib.lock',
47
45
    'LockHooks')
48
 
known_hooks.register_lazy(('bzrlib.merge', 'Merger.hooks'), 'bzrlib.merge',
49
 
    'MergeHooks')
50
46
known_hooks.register_lazy(('bzrlib.msgeditor', 'hooks'), 'bzrlib.msgeditor',
51
47
    'MessageEditorHooks')
52
48
known_hooks.register_lazy(('bzrlib.mutabletree', 'MutableTree.hooks'),
58
54
known_hooks.register_lazy(
59
55
    ('bzrlib.version_info_formats.format_rio', 'RioVersionInfoBuilder.hooks'),
60
56
    'bzrlib.version_info_formats.format_rio', 'RioVersionInfoBuilderHooks')
61
 
known_hooks.register_lazy(
62
 
    ('bzrlib.merge_directive', '_BaseMergeDirective.hooks'),
63
 
    'bzrlib.merge_directive', 'MergeDirectiveHooks')
64
57
 
65
58
 
66
59
def known_hooks_key_to_object((module_name, member_name)):
183
176
    :ivar introduced: A version tuple specifying what version the hook was
184
177
        introduced in. None indicates an unknown version.
185
178
    :ivar deprecated: A version tuple specifying what version the hook was
186
 
        deprecated or superseded in. None indicates that the hook is not
187
 
        superseded or deprecated. If the hook is superseded then the doc
 
179
        deprecated or superceded in. None indicates that the hook is not
 
180
        superceded or deprecated. If the hook is superceded then the doc
188
181
        should describe the recommended replacement hook to register for.
189
182
    :ivar doc: The docs for using the hook.
190
183
    """
221
214
        strings.append('Introduced in: %s' % introduced_string)
222
215
        if self.deprecated:
223
216
            deprecated_string = _format_version_tuple(self.deprecated)
224
 
            strings.append('Deprecated in: %s' % deprecated_string)
 
217
        else:
 
218
            deprecated_string = 'Not deprecated'
 
219
        strings.append('Deprecated in: %s' % deprecated_string)
225
220
        strings.append('')
226
 
        strings.extend(textwrap.wrap(self.__doc__,
227
 
            break_long_words=False))
 
221
        strings.extend(textwrap.wrap(self.__doc__))
228
222
        strings.append('')
229
223
        return '\n'.join(strings)
230
224
 
279
273
 
280
274
See `Using hooks`_ in the User Guide for examples.
281
275
 
282
 
.. _Using hooks: ../user-guide/hooks.html
 
276
.. _Using hooks: ../user-guide/index.html#using-hooks
283
277
 
284
278
The class that contains each hook is given before the hooks it supplies. For
285
279
instance, BranchHooks as the class is the hooks class for