/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: James Westby
  • Date: 2009-04-06 22:31:35 UTC
  • mto: This revision was merged to the branch mainline in revision 4263.
  • Revision ID: james.westby@canonical.com-20090406223135-f7os74eyxlbpxtal
Update the comments based on those in the test.

Show diffs side-by-side

added added

removed removed

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