~abentley/bzrtools/bzrtools.dev

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""\
Various useful plugins for working with bzr.
"""
import bzrlib.commands
import push
import annotate
import shelf
import conflicts

bzrlib.commands.OPTIONS['ignored'] = None

class cmd_clean_tree(bzrlib.commands.Command):
    """Remove unwanted files from working tree.
    Normally, ignored files are left alone.  The --ignored flag will cause them
    to be deleted as well.
    """
    takes_options = ['ignored']
    def run(self, ignored=False):
        import clean_tree
        clean_tree.clean_tree(ignored=ignored)

class cmd_conflicted(bzrlib.commands.Command):
    """List files that have conflicts
    """
    takes_options = ['ignored']
    def run(self, ignored=False):
        import clean_tree
        clean_tree.clean_tree(ignored=ignored)

commands = [push.cmd_push, annotate.cmd_annotate, shelf.cmd_shelve, 
            shelf.cmd_unshelve, cmd_clean_tree, conflicts.cmd_conflicts,
            conflicts.cmd_resolve]
from errors import NoPyBaz
try:
    import baz_import
    commands.append(baz_import.cmd_baz_import)

except NoPyBaz:
    class cmd_baz_import(bzrlib.commands.Command):
        """Disabled. (Requires PyBaz)"""
    commands.append(cmd_baz_import)

if hasattr(bzrlib.commands, 'register_command'):
    for command in commands:
        bzrlib.commands.register_command(command)