~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/changelog_merge/__init__.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
 
56
56
# Since we are a built-in plugin we share the bzrlib version
57
57
from bzrlib import version_info
 
58
from bzrlib.hooks import install_lazy_named_hook
58
59
 
59
60
# Put most of the code in a separate module that we lazy-import to keep the
60
61
# overhead of this plugin as minimal as possible.
61
 
from bzrlib.lazy_import import lazy_import
62
 
lazy_import(globals(), """
63
 
from bzrlib.plugins.changelog_merge import changelog_merge as _mod_changelog_merge
64
 
""")
65
 
 
66
 
from bzrlib.merge import Merger
67
 
 
68
 
 
69
62
def changelog_merge_hook(merger):
70
63
    """Merger.merge_file_content hook for GNU-format ChangeLog files."""
71
 
    return _mod_changelog_merge.ChangeLogMerger(merger)
72
 
 
73
 
 
74
 
def install_hook():
75
 
    Merger.hooks.install_named_hook(
76
 
        'merge_file_content', changelog_merge_hook, 'GNU ChangeLog file merge')
77
 
install_hook()
78
 
 
 
64
    from bzrlib.plugins.changelog_merge.changelog_merge import ChangeLogMerger
 
65
    return ChangeLogMerger(merger)
 
66
 
 
67
install_lazy_named_hook("bzrlib.merge", "Merger.hooks", "merge_file_content",
 
68
    changelog_merge_hook, 'GNU ChangeLog file merge')
79
69
 
80
70
def load_tests(basic_tests, module, loader):
81
71
    testmod_names = [
84
74
    basic_tests.addTest(loader.loadTestsFromModuleNames(
85
75
            ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
86
76
    return basic_tests
87