1
1
# Copyright (C) 2005, 2006, 2007 Aaron Bentley <aaron@aaronbentley.com>
2
# Copyright (C) 2005, 2006 Canonical Limited.
2
# Copyright (C) 2005, 2006, 2011 Canonical Limited.
3
3
# Copyright (C) 2006 Michael Ellerman.
5
5
# This program is free software; you can redistribute it and/or modify
380
380
If --branch is specified, the branch will be deleted too, but only if the
381
381
the branch has no new commits (relative to its parent).
383
If bzr-pipeline is also installed, the --store option will store changes
384
in the branch before deleting the tree. To restore the changes, do::
386
bzr checkout --lightweight $BRANCH $CHECKOUT
387
bzr switch-pipe -d $CHECKOUT `bzr nick -d $CHECKOUT`
383
takes_options = [Option("branch", help="Remove associated branch from"
385
Option('force', help='Delete tree even if contents are'
390
def takes_options(self):
391
options = [Option("branch", help="Remove associated branch from"
393
Option('force', help='Delete tree even if contents are'
396
import bzrlib.plugins.pipeline
400
options.append(Option('store', help='Store uncommitted changes in'
387
403
takes_args = ["checkout"]
388
def run(self, checkout, branch=False, force=False):
404
def run(self, checkout, branch=False, force=False, store=False):
389
405
from zap import zap
390
return zap(checkout, remove_branch=branch, allow_modified=force)
409
raise BzrCommandError('Cannot store changes in branch, then'
411
return zap(checkout, remove_branch=branch, allow_modified=force,
393
415
class cmd_cbranch(BzrToolsCommand):