~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Robert Collins
  • Date: 2005-08-25 12:46:42 UTC
  • mfrom: (1116)
  • mto: (974.1.50) (1185.1.10) (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1139.
  • Revision ID: robertc@robertcollins.net-20050825124642-45ed1cd74db10370
merge from mpool

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
# would help with validation and shell completion.
28
28
 
29
29
 
 
30
# TODO: Help messages for options.
 
31
 
 
32
# TODO: Define arguments by objects, rather than just using names.
 
33
# Those objects can specify the expected type of the argument, which
 
34
# would help with validation and shell completion.
 
35
 
 
36
 
30
37
import sys
31
38
import os
32
39
 
33
40
import bzrlib
 
41
import bzrlib.trace
34
42
from bzrlib.trace import mutter, note, log_error, warning
35
43
from bzrlib.errors import BzrError, BzrCheckError, BzrCommandError
36
44
from bzrlib.branch import find_branch
1378
1386
        import bzrlib.ui
1379
1387
        from bzrlib.selftest import selftest
1380
1388
        # we don't want progress meters from the tests to go to the
1381
 
        # real output.
 
1389
        # real output; and we don't want log messages cluttering up
 
1390
        # the real logs.
1382
1391
        save_ui = bzrlib.ui.ui_factory
 
1392
        bzrlib.trace.info('running tests...')
 
1393
        bzrlib.trace.disable_default_logging()
1383
1394
        try:
1384
1395
            bzrlib.ui.ui_factory = bzrlib.ui.SilentUIFactory()
1385
 
            return int(not selftest(verbose=verbose, pattern=pattern))
 
1396
            result = selftest(verbose=verbose, pattern=pattern)
 
1397
            if result:
 
1398
                bzrlib.trace.info('tests passed')
 
1399
            else:
 
1400
                bzrlib.trace.info('tests failed')
 
1401
            return int(not result)
1386
1402
        finally:
 
1403
            bzrlib.trace.enable_default_logging()
1387
1404
            bzrlib.ui.ui_factory = save_ui
1388
1405
 
1389
1406
 
1933
1950
 
1934
1951
def main(argv):
1935
1952
    import bzrlib.ui
1936
 
    
1937
 
    bzrlib.trace.open_tracefile(argv)
1938
 
 
 
1953
    bzrlib.trace.log_startup(argv)
1939
1954
    bzrlib.ui.ui_factory = bzrlib.ui.TextUIFactory()
1940
1955
 
1941
1956
    try: