~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Aaron Bentley
  • Date: 2008-11-12 17:09:36 UTC
  • Revision ID: aaron@aaronbentley.com-20081112170936-3dybsv7il8gxhchz
Use bzrlib's getchar

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
Various useful commands for working with bzr.
19
19
"""
20
20
 
21
 
from bzrlib import ignores, option
22
 
from bzrlib.commands import (
23
 
    builtin_command_names,
24
 
    plugin_cmds,
25
 
    )
 
21
from bzrlib import ignores
 
22
from bzrlib.commands import plugin_cmds
26
23
from version import version_info, __version__
27
24
 
28
25
 
30
27
 
31
28
 
32
29
commands = {
 
30
    'cmd_branches': [],
33
31
    'cmd_branch_history': [],
34
32
    'cmd_cbranch': [],
35
33
    'cmd_cdiff': [],
36
 
    'cmd_conflict_diff': [],
37
 
    'cmd_create_mirror': [],
 
34
    'cmd_clean_tree': [],
38
35
    'cmd_fetch_ghosts': ['fetch-missing'],
39
36
    'cmd_graph_ancestry': [],
40
37
    'cmd_import': [],
42
39
    'cmd_multi_pull': [],
43
40
    'cmd_patch': [],
44
41
    'cmd_rspush': [],
45
 
    'cmd_shelf1': [],
 
42
    'cmd_shelf': [],
46
43
    'cmd_shell': [],
47
 
    'cmd_shelve1': [],
 
44
    'cmd_shelve1': ['shelve'],
48
45
    'cmd_trees': [],
49
 
    'cmd_unshelve1': [],
 
46
    'cmd_unshelve1': ['unshelve'],
50
47
    'cmd_zap': [],
51
48
}
52
49
 
55
52
    plugin_cmds.register_lazy(cmd_name, aliases,
56
53
                              'bzrlib.plugins.bzrtools.command_classes')
57
54
 
58
 
list_branches_aliases = (['branches'] if 'branches' not in
59
 
                         builtin_command_names() else [])
60
 
 
61
 
plugin_cmds.register_lazy('cmd_list_branches', list_branches_aliases,
62
 
                          'bzrlib.plugins.bzrtools.command_classes')
63
 
 
64
55
plugin_cmds.register_lazy('cmd_heads', [], 'bzrlib.plugins.bzrtools.heads')
65
56
 
66
 
 
67
 
option.diff_writer_registry.register_lazy(
68
 
    'auto-color', 'bzrlib.plugins.bzrtools.colordiff', 'auto_diff_writer',
69
 
    'Colorized diffs, if supported',
70
 
)
71
 
option.diff_writer_registry.register_lazy(
72
 
    'color', 'bzrlib.plugins.bzrtools.colordiff', 'DiffWriter',
73
 
    'Colorized diffs',
74
 
)
75
 
option.diff_writer_registry.default_key = 'auto-color'
76
 
 
77
 
 
78
57
def test_suite():
79
58
    from bzrlib.tests.TestUtil import TestLoader
80
59
    import tests
81
60
    from doctest import DocTestSuite, ELLIPSIS
82
61
    from unittest import TestSuite
83
62
    import bzrtools
 
63
    import tests.clean_tree
84
64
    import tests.test_dotgraph
 
65
    import tests.is_clean
85
66
    import tests.test_cbranch
86
 
    import tests.test_conflict_diff
87
 
    from bzrlib.plugins.bzrtools.tests import test_fetch_ghosts
88
 
    import tests.test_graph
89
67
    import tests.test_link_tree
90
68
    import tests.test_patch
91
 
    import tests.test_mirror
 
69
    import tests.test_rspush
92
70
    import tests.upstream_import
93
71
    import zap
94
72
    import tests.blackbox
95
73
    import tests.shelf_tests
96
74
    result = TestSuite()
97
75
    result.addTest(DocTestSuite(bzrtools, optionflags=ELLIPSIS))
 
76
    result.addTest(tests.clean_tree.test_suite())
98
77
    result.addTest(tests.test_suite())
99
78
    result.addTest(TestLoader().loadTestsFromModule(tests.shelf_tests))
100
79
    result.addTest(tests.blackbox.test_suite())
101
 
    result.addTest(TestLoader().loadTestsFromModule(tests.upstream_import))
 
80
    result.addTest(tests.upstream_import.test_suite())
102
81
    result.addTest(zap.test_suite())
103
82
    result.addTest(TestLoader().loadTestsFromModule(tests.test_dotgraph))
104
 
    result.addTest(TestLoader().loadTestsFromModule(test_fetch_ghosts))
105
 
    result.addTest(TestLoader().loadTestsFromModule(tests.test_graph))
 
83
    result.addTest(TestLoader().loadTestsFromModule(tests.is_clean))
106
84
    result.addTest(TestLoader().loadTestsFromModule(tests.test_link_tree))
107
85
    result.addTest(TestLoader().loadTestsFromModule(tests.test_patch))
 
86
    result.addTest(TestLoader().loadTestsFromModule(tests.test_rspush))
108
87
    result.addTest(TestLoader().loadTestsFromModule(tests.test_cbranch))
109
 
    result.addTest(TestLoader().loadTestsFromModule(tests.test_conflict_diff))
110
 
    result.addTest(TestLoader().loadTestsFromModule(tests.test_mirror))
111
88
    return result