~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Jelmer Vernooij
  • Date: 2011-02-20 13:34:07 UTC
  • mto: (5622.4.1 uninstall-hook)
  • mto: This revision was merged to the branch mainline in revision 5747.
  • Revision ID: jelmer@samba.org-20110220133407-zhgrvuhhc1e3j2fn
Add more lazily usable hook points.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
 
62
62
class MergeHooks(hooks.Hooks):
63
63
 
64
 
    def __init__(self):
65
 
        hooks.Hooks.__init__(self)
66
 
        self.create_hook(hooks.HookPoint('merge_file_content',
 
64
    def __init__(self, module_name, member_name):
 
65
        hooks.Hooks.__init__(self, module_name, member_name)
 
66
        self.add_hook('merge_file_content',
67
67
            "Called with a bzrlib.merge.Merger object to create a per file "
68
68
            "merge object when starting a merge. "
69
69
            "Should return either None or a subclass of "
73
73
            "side has deleted the file and the other has changed it). "
74
74
            "See the AbstractPerFileMerger API docs for details on how it is "
75
75
            "used by merge.",
76
 
            (2, 1), None))
 
76
            (2, 1))
77
77
 
78
78
 
79
79
class AbstractPerFileMerger(object):
263
263
 
264
264
class Merger(object):
265
265
 
266
 
    hooks = MergeHooks()
 
266
    hooks = MergeHooks("bzrlib.merge", "Merger.hooks")
267
267
 
268
268
    def __init__(self, this_branch, other_tree=None, base_tree=None,
269
269
                 this_tree=None, pb=None, change_reporter=None,