355
357
(wt, path) = workingtree.WorkingTree.open_containing(filename)
357
359
except NoWorkingTree, e:
359
(br, path) = branch.Branch.open_containing(path)
361
commit = CommitDialog(wt, path, not br)
360
from dialog import error_dialog
361
error_dialog(_('Directory does not have a working tree'),
362
_('Operation aborted.'))
363
return 1 # should this be retval=3?
365
# It is a good habit to keep things locked for the duration, but it
366
# could cause difficulties if someone wants to do things in another
367
# window... We could lock_read() until we actually go to commit
368
# changes... Just a thought.
371
dlg = CommitDialog(wt)
366
377
class cmd_gstatus(GTKCommand):
612
623
register_command(cmd_gselftest)
626
class cmd_test_gtk(GTKCommand):
627
"""Version of selftest that just runs the gtk test suite."""
629
takes_options = ['verbose',
630
Option('one', short_name='1',
631
help='stop when one test fails'),
632
Option('benchmark', help='run the benchmarks.'),
633
Option('lsprof-timed',
634
help='generate lsprof output for benchmarked'
635
' sections of code.'),
637
help='list the tests instead of running them'),
638
Option('randomize', type=str, argname="SEED",
639
help='randomize the order of tests using the given'
640
' seed or "now" for the current time'),
642
takes_args = ['testspecs*']
644
def run(self, verbose=None, one=False, benchmark=None,
645
lsprof_timed=None, list_only=False, randomize=None,
646
testspecs_list=None):
647
from bzrlib import __path__ as bzrlib_path
648
from bzrlib.tests import selftest
650
print '%10s: %s' % ('bzrlib', bzrlib_path[0])
652
print 'No benchmarks yet'
655
test_suite_factory = bench_suite
658
# TODO: should possibly lock the history file...
659
benchfile = open(".perf_history", "at", buffering=1)
661
test_suite_factory = test_suite
666
if testspecs_list is not None:
667
pattern = '|'.join(testspecs_list)
672
result = selftest(verbose=verbose,
675
test_suite_factory=test_suite_factory,
676
lsprof_timed=lsprof_timed,
677
bench_history=benchfile,
679
random_seed=randomize,
682
if benchfile is not None:
685
register_command(cmd_test_gtk)
616
689
gettext.install('olive-gtk')