~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Benoît Pierre
  • Date: 2008-11-16 17:50:52 UTC
  • mto: This revision was merged to the branch mainline in revision 683.
  • Revision ID: benoit.pierre@gmail.com-20081116175052-8ldrpprvpfq3wscm
Check if STDOUT is a TTY in has_ansi_colors: return False if not.

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
 
21
from bzrlib import ignores
22
22
from bzrlib.commands import plugin_cmds
23
23
from version import version_info, __version__
24
24
 
31
31
    'cmd_branch_history': [],
32
32
    'cmd_cbranch': [],
33
33
    'cmd_cdiff': [],
34
 
    'cmd_conflict_diff': [],
35
 
    'cmd_create_mirror': [],
 
34
    'cmd_clean_tree': [],
36
35
    'cmd_fetch_ghosts': ['fetch-missing'],
37
36
    'cmd_graph_ancestry': [],
38
37
    'cmd_import': [],
40
39
    'cmd_multi_pull': [],
41
40
    'cmd_patch': [],
42
41
    'cmd_rspush': [],
43
 
    'cmd_shelf1': [],
 
42
    'cmd_shelf': [],
44
43
    'cmd_shell': [],
45
 
    'cmd_shelve1': [],
 
44
    'cmd_shelve1': ['shelve'],
46
45
    'cmd_trees': [],
47
 
    'cmd_unshelve1': [],
 
46
    'cmd_unshelve1': ['unshelve'],
48
47
    'cmd_zap': [],
49
48
}
50
49
 
53
52
    plugin_cmds.register_lazy(cmd_name, aliases,
54
53
                              'bzrlib.plugins.bzrtools.command_classes')
55
54
 
56
 
 
57
55
plugin_cmds.register_lazy('cmd_heads', [], 'bzrlib.plugins.bzrtools.heads')
58
56
 
59
 
 
60
 
option.diff_writer_registry.register_lazy(
61
 
    'auto-color', 'bzrlib.plugins.bzrtools.colordiff', 'auto_diff_writer',
62
 
    'Colorized diffs, if supported',
63
 
)
64
 
option.diff_writer_registry.register_lazy(
65
 
    'color', 'bzrlib.plugins.bzrtools.colordiff', 'DiffWriter',
66
 
    'Colorized diffs',
67
 
)
68
 
option.diff_writer_registry.default_key = 'auto-color'
69
 
 
70
 
 
71
57
def test_suite():
72
58
    from bzrlib.tests.TestUtil import TestLoader
73
59
    import tests
74
60
    from doctest import DocTestSuite, ELLIPSIS
75
61
    from unittest import TestSuite
76
62
    import bzrtools
 
63
    import tests.clean_tree
77
64
    import tests.test_dotgraph
78
65
    import tests.is_clean
79
66
    import tests.test_cbranch
80
 
    import tests.test_conflict_diff
81
 
    from bzrlib.plugins.bzrtools.tests import test_fetch_ghosts
82
67
    import tests.test_link_tree
83
68
    import tests.test_patch
84
69
    import tests.test_rspush
85
 
    import tests.test_mirror
86
70
    import tests.upstream_import
87
71
    import zap
88
72
    import tests.blackbox
89
73
    import tests.shelf_tests
90
74
    result = TestSuite()
91
75
    result.addTest(DocTestSuite(bzrtools, optionflags=ELLIPSIS))
 
76
    result.addTest(tests.clean_tree.test_suite())
92
77
    result.addTest(tests.test_suite())
93
78
    result.addTest(TestLoader().loadTestsFromModule(tests.shelf_tests))
94
79
    result.addTest(tests.blackbox.test_suite())
96
81
    result.addTest(zap.test_suite())
97
82
    result.addTest(TestLoader().loadTestsFromModule(tests.test_dotgraph))
98
83
    result.addTest(TestLoader().loadTestsFromModule(tests.is_clean))
99
 
    result.addTest(TestLoader().loadTestsFromModule(test_fetch_ghosts))
100
84
    result.addTest(TestLoader().loadTestsFromModule(tests.test_link_tree))
101
85
    result.addTest(TestLoader().loadTestsFromModule(tests.test_patch))
102
86
    result.addTest(TestLoader().loadTestsFromModule(tests.test_rspush))
103
87
    result.addTest(TestLoader().loadTestsFromModule(tests.test_cbranch))
104
 
    result.addTest(TestLoader().loadTestsFromModule(tests.test_conflict_diff))
105
 
    result.addTest(TestLoader().loadTestsFromModule(tests.test_mirror))
106
88
    return result