453
453
To re-create the working tree, use "bzr checkout".
455
455
_see_also = ['checkout', 'working-trees']
456
takes_args = ['location?']
456
takes_args = ['location*']
457
457
takes_options = [
459
459
help='Remove the working tree even if it has '
460
460
'uncommitted changes.'),
463
def run(self, location='.', force=False):
464
d = bzrdir.BzrDir.open(location)
467
working = d.open_workingtree()
468
except errors.NoWorkingTree:
469
raise errors.BzrCommandError("No working tree to remove")
470
except errors.NotLocalUrl:
471
raise errors.BzrCommandError("You cannot remove the working tree"
474
if (working.has_changes()):
475
raise errors.UncommittedChanges(working)
477
working_path = working.bzrdir.root_transport.base
478
branch_path = working.branch.bzrdir.root_transport.base
479
if working_path != branch_path:
480
raise errors.BzrCommandError("You cannot remove the working tree"
481
" from a lightweight checkout")
483
d.destroy_workingtree()
463
def run(self, location_list, force=False):
464
if not location_list:
467
for location in location_list:
468
d = bzrdir.BzrDir.open(location)
471
working = d.open_workingtree()
472
except errors.NoWorkingTree:
473
raise errors.BzrCommandError("No working tree to remove")
474
except errors.NotLocalUrl:
475
raise errors.BzrCommandError("You cannot remove the working tree"
478
if (working.has_changes()):
479
raise errors.UncommittedChanges(working)
481
working_path = working.bzrdir.root_transport.base
482
branch_path = working.branch.bzrdir.root_transport.base
483
if working_path != branch_path:
484
raise errors.BzrCommandError("You cannot remove the working tree"
485
" from a lightweight checkout")
487
d.destroy_workingtree()
486
490
class cmd_revno(Command):