~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/launchpad/lp_propose.py

  • Committer: Vincent Ladeuil
  • Date: 2011-02-10 12:37:27 UTC
  • mto: This revision was merged to the branch mainline in revision 5661.
  • Revision ID: v.ladeuil+lp@free.fr-20110210123727-8e0pu4wtlt6fj7nf
thread is already a python module, avoid confusion and use cethread instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2010, 2011 Canonical Ltd
 
1
# Copyright (C) 2010 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
24
24
 
25
25
from bzrlib import (
26
26
    msgeditor,
27
 
    )
 
27
)
28
28
from bzrlib.plugins.launchpad import (
29
29
    lp_api,
30
30
    lp_registration,
31
 
    )
 
31
)
32
32
""")
33
33
 
34
34
 
36
36
    """Hooks for proposing a merge on Launchpad."""
37
37
 
38
38
    def __init__(self):
39
 
        hooks.Hooks.__init__(self, "bzrlib.plugins.launchpad.lp_propose",
40
 
            "Proposer.hooks")
41
 
        self.add_hook('get_prerequisite',
42
 
            "Return the prerequisite branch for proposing as merge.", (2, 1))
43
 
        self.add_hook('merge_proposal_body',
44
 
            "Return an initial body for the merge proposal message.", (2, 1))
 
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
        )
45
52
 
46
53
 
47
54
class Proposer(object):
142
149
            if mp.queue_status in ('Merged', 'Rejected'):
143
150
                continue
144
151
            if mp.target_branch.self_link == self.target_branch.lp.self_link:
145
 
                raise errors.BzrCommandError(gettext(
146
 
                    'There is already a branch merge proposal: %s') %
 
152
                raise errors.BzrCommandError(
 
153
                    'There is already a branch merge proposal: %s' %
147
154
                    lp_api.canonical_url(mp))
148
155
 
149
156
    def _get_prerequisite_branch(self):