~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: abentley
  • Date: 2005-10-15 01:21:20 UTC
  • mfrom: (223)
  • mto: (147.2.17)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: abentley@lappy-20051015012120-d9c59d0ac91ff4ad
Merge from the mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
                                                 "external")))
12
12
 
13
13
bzrlib.commands.OPTIONS['ignored'] = None
 
14
bzrlib.commands.OPTIONS['detrius'] = None
14
15
 
15
16
class cmd_clean_tree(bzrlib.commands.Command):
16
17
    """Remove unwanted files from working tree.
17
 
    Normally, ignored files are left alone.  The --ignored flag will cause them
18
 
    to be deleted as well.
 
18
    Normally, ignored files are left alone.
 
19
 
 
20
    OPTIONS:
 
21
    --detrius Delete conflict files and merge backups. (*.THIS, *.BASE, 
 
22
              *.OTHER, *~)
 
23
    --ignored Delete all ignored files.
 
24
    --dry-run Show files to delete instead of deleting them.
19
25
    """
20
 
    takes_options = ['ignored']
21
 
    def run(self, ignored=False):
 
26
    takes_options = ['ignored', 'detrius', 'dry-run']
 
27
    def run(self, ignored=False, detrius=False, dry_run=False):
22
28
        import clean_tree
23
 
        clean_tree.clean_tree(ignored=ignored)
 
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, 
 
33
                                                detrius=detrius)
 
34
        clean_tree.clean_tree(deletables, dry_run=dry_run)
24
35
 
25
36
bzrlib.commands.OPTIONS['no-collapse'] = None
26
37
bzrlib.commands.OPTIONS['no-antialias'] = None
93
104
 
94
105
 
95
106
 
96
 
commands = [push.cmd_push, annotate.cmd_annotate, shelf.cmd_shelve, 
 
107
commands = [push.cmd_push, shelf.cmd_shelve, 
97
108
            shelf.cmd_unshelve, cmd_clean_tree, cmd_graph_ancestry,
98
109
            cmd_fetch_ghosts, cmd_patch]
 
110
 
 
111
import bzrlib.builtins
 
112
if not hasattr(bzrlib.builtins, "cmd_annotate"):
 
113
    commands.append(annotate.cmd_annotate)
 
114
 
99
115
from errors import NoPyBaz
100
116
try:
101
117
    import baz_import