10
10
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__),
12
from bzrlib.option import Option
13
bzrlib.commands.OPTIONS['ignored'] = None
14
bzrlib.commands.OPTIONS['detrius'] = None
14
Option.OPTIONS['ignored'] = Option('ignored',
15
help='delete all ignored files.')
16
Option.OPTIONS['detrius'] = Option('detrius',
17
help='delete conflict files merge backups, and failed selftest dirs.' +
18
'(*.THIS, *.BASE, *.OTHER, *~, *.tmp')
19
Option.OPTIONS['dry-run'] = Option('dry-run',
20
help='show files to delete instead of deleting them.')
16
22
class cmd_clean_tree(bzrlib.commands.Command):
17
23
"""Remove unwanted files from working tree.
18
24
Normally, ignored files are left alone.
21
--detrius Delete conflict files and merge backups. (*.THIS, *.BASE,
23
--ignored Delete all ignored files.
24
--dry-run Show files to delete instead of deleting them.
26
26
takes_options = ['ignored', 'detrius', 'dry-run']
27
27
def run(self, ignored=False, detrius=False, dry_run=False):
29
from bzrlib.branch import Branch
30
br = Branch.open_containing('.')
31
tree = br.working_tree()
32
deletables = clean_tree.iter_deletables(tree, ignored=ignored,
34
clean_tree.clean_tree(deletables, dry_run=dry_run)
28
from clean_tree import clean_tree
29
clean_tree('.', ignored=ignored, detrius=detrius, dry_run=dry_run)
36
bzrlib.commands.OPTIONS['no-collapse'] = None
37
bzrlib.commands.OPTIONS['no-antialias'] = None
38
bzrlib.commands.OPTIONS['cluster'] = None
39
bzrlib.commands.OPTIONS['merge-branch'] = str
31
Option.OPTIONS['no-collapse'] = Option('no-collapse')
32
Option.OPTIONS['no-antialias'] = Option('no-antialias')
33
Option.OPTIONS['cluster'] = Option('cluster')
34
Option.OPTIONS['merge-branch'] = Option('merge-branch',type=str)
41
36
class cmd_graph_ancestry(bzrlib.commands.Command):
42
37
"""Produce ancestry graphs using dot.
122
117
class cmd_baz_import(bzrlib.commands.Command):
123
118
"""Disabled. (Requires PyBaz)"""
119
takes_args = ['to_root_dir?', 'from_archive?']
120
takes_options = ['verbose']
121
def run(self, to_root_dir=None, from_archive=None, verbose=False):
122
print "This command is disabled. Please install PyBaz."
124
123
commands.append(cmd_baz_import)
126
125
if hasattr(bzrlib.commands, 'register_command'):