15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
from bzrlib import builtins, errors, merge, revision as _mod_revision, trace
22
revision as _mod_revision, trace,
19
25
from bzrlib.branch import Branch
20
26
from bzrlib.bzrdir import BzrDir
21
27
from bzrlib.commands import Command
22
from bzrlib.option import ListOption, Option, RegistryOption
28
from bzrlib.option import Option, RegistryOption
23
29
from bzrlib.osutils import pathjoin
24
30
from bzrlib.switch import switch
25
31
from bzrlib.workingtree import WorkingTree
152
158
trace.note('Created and switched to pipe "%s".' % pipe)
161
class cmd_rename_pipe(PipeCommand):
162
"""Rename a pipe to a different name.
164
This will rename the branch directory and update the pipeline metadata.
165
It is not connected to the branch nick.
168
takes_args = ['new_name']
170
def run(self, new_name):
171
tree, manager = self._get_checkout_manager('.')
172
manager.rename_pipe(new_name, tree)
155
174
class cmd_merge(builtins.cmd_merge):
156
175
#Support merge --uncommitted PIPE
157
176
__doc__ = builtins.cmd_merge.__doc__
240
259
trace.note('Switched from "%s" to "%s".' % (old, target.nick))
262
class cmd_store(PipeCommand):
266
"""Store uncommitted changes in the pipe."""
269
checkout, manager = self._get_checkout_manager('.')
270
manager.store_uncommitted(checkout)
243
273
class cmd_show_pipeline(PipeCommand):
244
274
"""Show the current pipeline.
369
399
raise errors.BzrCommandError(
370
400
'No location specified and none remembered.')
371
manager.sync_pipeline(location, remote)
374
class cmd_lp_submit(PipeCommand):
375
"""Submit the specified pipe to Launchpad."""
377
takes_options = [Option('staging',
378
help='Propose the merge on staging.'),
379
Option('message', short_name='m', type=unicode,
380
help='Commit message.'),
381
ListOption('review', short_name='R', type=unicode,
382
help='Requested reviewer and optional type.')]
384
takes_args = ['submit_branch?']
386
def run(self, submit_branch=None, review=None, staging=False,
388
from bzrlib.plugins.pipeline import lp_submit
389
checkout, manager = self._get_checkout_manager(checkout_optional=True,
395
for review in review:
397
reviews.append(review.split('=', 2))
399
reviews.append((review, ''))
400
if submit_branch is None:
401
submit_branch = manager.storage.branch.get_submit_branch()
402
if submit_branch is None:
405
target = Branch.open(submit_branch)
406
submitter = lp_submit.Submitter(checkout, manager, target, message,
408
submitter.check_submission()
402
manager.sync_pipeline(checkout, location, remote)
404
ui.ui_factory.clear_term()