~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/launchpad/lp_propose.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:
35
35
class ProposeMergeHooks(hooks.Hooks):
36
36
    """Hooks for proposing a merge on Launchpad."""
37
37
 
38
 
    def __init__(self):
39
 
        hooks.Hooks.__init__(self)
40
 
        self.create_hook(
41
 
            hooks.HookPoint(
42
 
                'get_prerequisite',
43
 
                "Return the prerequisite branch for proposing as merge.",
44
 
                (2, 1), None),
45
 
        )
46
 
        self.create_hook(
47
 
            hooks.HookPoint(
48
 
                'merge_proposal_body',
49
 
                "Return an initial body for the merge proposal message.",
50
 
                (2, 1), None),
51
 
        )
 
38
    def __init__(self, module_name, member_name):
 
39
        hooks.Hooks.__init__(self, module_name, member_name)
 
40
        self.add_hook('get_prerequisite',
 
41
            "Return the prerequisite branch for proposing as merge.", (2, 1))
 
42
        self.add_hook('merge_proposal_body',
 
43
            "Return an initial body for the merge proposal message.", (2, 1))
52
44
 
53
45
 
54
46
class Proposer(object):
55
47
 
56
 
    hooks = ProposeMergeHooks()
 
48
    hooks = ProposeMergeHooks("bzrlib.plugins.launchpad.lp_propose", "Proposer.hooks")
57
49
 
58
50
    def __init__(self, tree, source_branch, target_branch, message, reviews,
59
51
                 staging=False, approve=False):