~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to command_classes.py

  • Committer: Aaron Bentley
  • Date: 2009-03-11 02:13:43 UTC
  • Revision ID: aaron@aaronbentley.com-20090311021343-gq6i3v5gmkucye7u
Remove clean-tree (now in bzr core)

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
from command import BzrToolsCommand
44
44
 
45
45
 
46
 
class cmd_clean_tree(BzrToolsCommand):
47
 
    """Remove unwanted files from working tree.
48
 
 
49
 
    By default, only unknown files, not ignored files, are deleted.  Versioned
50
 
    files are never deleted.
51
 
 
52
 
    Another class is 'detritus', which includes files emitted by bzr during
53
 
    normal operations and selftests.  (The value of these files decreases with
54
 
    time.)
55
 
 
56
 
    If no options are specified, unknown files are deleted.  Otherwise, option
57
 
    flags are respected, and may be combined.
58
 
 
59
 
    To check what clean-tree will do, use --dry-run.
60
 
    """
61
 
    takes_options = [Option('ignored', help='Delete all ignored files.'),
62
 
                     Option('detritus', help='Delete conflict files, merge'
63
 
                            ' backups, and failed selftest dirs.'),
64
 
                     Option('unknown',
65
 
                            help='Delete files unknown to bzr (default).'),
66
 
                     Option('dry-run', help='Show files to delete instead of'
67
 
                            ' deleting them.'),
68
 
                     Option('force', help='Do not prompt before deleting.')]
69
 
    def run(self, unknown=False, ignored=False, detritus=False, dry_run=False,
70
 
            force=False):
71
 
        from clean_tree import clean_tree
72
 
        if not (unknown or ignored or detritus):
73
 
            unknown = True
74
 
        if dry_run:
75
 
            force = True
76
 
        clean_tree('.', unknown=unknown, ignored=ignored, detritus=detritus, 
77
 
                   dry_run=dry_run, no_prompt=force)
78
 
 
79
 
 
80
46
class cmd_graph_ancestry(BzrToolsCommand):
81
47
    """Produce ancestry graphs using dot.
82
48