30
30
__version__ = version_string
33
class cmd_pqm_submit(Command):
34
"""Submit the parent tree to the pqm.
37
$ echo "star-merge $PARENT $TARGET"
39
| mail pqm@somewhere -s "merge text"
41
But it pays attention to who the local committer is
42
(using their e-mail address), and uses the local
43
gpg signing configuration. (As well as target pqm
46
The reason we use 'parent' instead of the local branch
47
is that most likely the local branch is not a public
48
branch. And the branch must be available to the pqm.
50
This can be configured at the branch level using ~/.bazaar/locations.conf.
53
pqm_email = PQM <pqm@example.com>
54
pqm_user_email = User Name <user@example.com>
55
submit_branch = http://code.example.com/code/project/devel
56
# Set public_branch appropriately for all branches in repository:
57
public_branch = http://code.example.com/code/emurphy/project
58
public_branch:policy = appendpath
59
[/home/emurphy/repo/branch]
60
# Override public_branch for this repository:
61
public_branch = http://alternate.host.example.com/other/public/branch
63
smtp_server = host:port
67
If you don't specify the smtp server, the message will be sent via localhost.
70
takes_args = ['location?']
73
help='Message to use on merge to pqm. '
74
'Currently must be a single line because of pqm limits.',
77
Option('dry-run', help='Print request instead of sending.'),
78
Option('public-location', type=str,
79
help='Use this url as the public location to the pqm.'),
80
Option('submit-branch', type=str,
81
help='Use this url as the target submission branch.'),
82
Option('ignore-local', help='Do not check the local branch or tree.'),
85
def run(self, location=None, message=None, public_location=None,
86
dry_run=False, submit_branch=None, ignore_local=False):
87
from bzrlib import trace, bzrdir
88
if __name__ != 'bzrlib.plugins.pqm':
89
trace.warning('The bzr-pqm plugin needs to be called'
90
' "bzrlib.plugins.pqm" not "%s"\n'
91
'Please rename the plugin.',
94
from bzrlib.plugins.pqm.pqm_submit import submit
97
tree, b, relpath = None, None, None
101
tree, b, relpath = bzrdir.BzrDir.open_containing_tree_or_branch(
105
self.add_cleanup(b.unlock)
106
if relpath and not tree and location != '.':
107
raise BzrCommandError(
108
'No working tree was found, but we were not given the '
109
'exact path to the branch.\n'
110
'We found a branch at: %s' % (b.base,))
112
raise BzrCommandError(
113
'You must supply a commit message for the pqm to use.')
114
submit(b, message=message, dry_run=dry_run,
115
public_location=public_location,
116
submit_location=submit_branch,
117
tree=tree, ignore_local=ignore_local)
119
class cmd_lp_land(Command):
120
"""Land the merge proposal for this branch via PQM.
122
The branch will be submitted to PQM according to the merge proposal. If
33
class cmd_tarmac_land(Command):
34
"""Set the Merge Proposal to be processed by Tarmac.
36
The branch will be handled by Tarmac according to the merge proposal. If
123
37
there is more than one one outstanding proposal for the branch, its
124
38
location must be specified.
147
61
def run(self, location=None, dry_run=False, testfix=False,
148
62
no_qa=False, incremental=False, rollback=None):
149
from bzrlib.plugins.pqm.lpland import Submitter
63
from bzrlib.plugins.tarmac_land.tarmac_land import Submitter
150
64
from bzrlib import branch as _mod_branch
151
from bzrlib.plugins.pqm.lpland import (
65
from bzrlib.plugins.tarmac_land.tarmac_land import (
152
66
MissingReviewError, MissingBugsError, MissingBugsIncrementalError)
154
branch = _mod_branch.Branch.open_containing('.')[0]
73
branch = _mod_branch.Branch.open_containing('.')[0]
159
74
if rollback and (no_qa or incremental):
160
75
print "--rollback option used. Ignoring --no-qa and --incremental."
177
92
"Link the bugs or remove the --incremental option.")
180
register_command(cmd_pqm_submit)
181
register_command(cmd_lp_land)
95
register_command(cmd_tarmac_land)
185
99
from bzrlib.tests import TestLoader
186
100
from unittest import TestSuite
188
from tests import test_lpland, test_pqm_submit
102
from tests import test_tarmac_land
190
104
loader = TestLoader()
191
105
return TestSuite([
192
loader.loadTestsFromModule(test_pqm_submit),
193
loader.loadTestsFromModule(test_lpland),
106
loader.loadTestsFromModule(test_tarmac_land),