~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-08-27 03:24:12 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20050827032412-c2d47fd725e193c4
Tweaks for clean-tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import bzrlib.commands
 
2
import push
 
3
import annotate
 
4
import shelf
 
5
import conflicts
 
6
 
 
7
bzrlib.commands.OPTIONS['ignored'] = None
 
8
 
 
9
class cmd_clean_tree(bzrlib.commands.Command):
 
10
    """Remove unwanted files from working tree.
 
11
    Normally, ignored files are left alone.  The --ignored flag will cause them
 
12
    to be deleted as well.
 
13
    """
 
14
    takes_options = ['ignored']
 
15
    def run(self, ignored=False):
 
16
        import clean_tree
 
17
        clean_tree.clean_tree(ignored=ignored)
 
18
 
 
19
class cmd_conflicted(bzrlib.commands.Command):
 
20
    """List files that have conflicts
 
21
    """
 
22
    takes_options = ['ignored']
 
23
    def run(self, ignored=False):
 
24
        import clean_tree
 
25
        clean_tree.clean_tree(ignored=ignored)
 
26
 
 
27
commands = [push.cmd_push, annotate.cmd_annotate, shelf.cmd_shelve, 
 
28
            shelf.cmd_unshelve, cmd_clean_tree, conflicts.cmd_conflicts]
 
29
from errors import NoPyBaz
 
30
try:
 
31
    import baz_import
 
32
    commands.append(baz_import.cmd_baz_import)
 
33
 
 
34
except NoPyBaz:
 
35
    class cmd_baz_import(bzrlib.commands.Command):
 
36
        """Disabled. (Requires PyBaz)"""
 
37
    commands.append(cmd_baz_import)
 
38
 
 
39
if hasattr(bzrlib.commands, 'register_command'):
 
40
    for command in commands:
 
41
        bzrlib.commands.register_command(command)