354
356
(wt, path) = workingtree.WorkingTree.open_containing(filename)
356
358
except NoWorkingTree, e:
358
(br, path) = branch.Branch.open_containing(path)
360
commit = CommitDialog(wt, path, not br)
359
from dialog import error_dialog
360
error_dialog(_('Directory does not have a working tree'),
361
_('Operation aborted.'))
362
return 1 # should this be retval=3?
364
# It is a good habit to keep things locked for the duration, but it
365
# could cause difficulties if someone wants to do things in another
366
# window... We could lock_read() until we actually go to commit
367
# changes... Just a thought.
370
dlg = CommitDialog(wt)
365
376
class cmd_gstatus(GTKCommand):
593
604
register_command(cmd_gselftest)
607
class cmd_test_gtk(GTKCommand):
608
"""Version of selftest that just runs the gtk test suite."""
610
takes_options = ['verbose',
611
Option('one', short_name='1',
612
help='stop when one test fails'),
613
Option('benchmark', help='run the benchmarks.'),
614
Option('lsprof-timed',
615
help='generate lsprof output for benchmarked'
616
' sections of code.'),
618
help='list the tests instead of running them'),
619
Option('randomize', type=str, argname="SEED",
620
help='randomize the order of tests using the given'
621
' seed or "now" for the current time'),
623
takes_args = ['testspecs*']
625
def run(self, verbose=None, one=False, benchmark=None,
626
lsprof_timed=None, list_only=False, randomize=None,
627
testspecs_list=None):
628
from bzrlib import __path__ as bzrlib_path
629
from bzrlib.tests import selftest
631
print '%10s: %s' % ('bzrlib', bzrlib_path[0])
633
print 'No benchmarks yet'
636
test_suite_factory = bench_suite
639
# TODO: should possibly lock the history file...
640
benchfile = open(".perf_history", "at", buffering=1)
642
test_suite_factory = test_suite
647
if testspecs_list is not None:
648
pattern = '|'.join(testspecs_list)
653
result = selftest(verbose=verbose,
656
test_suite_factory=test_suite_factory,
657
lsprof_timed=lsprof_timed,
658
bench_history=benchfile,
660
random_seed=randomize,
663
if benchfile is not None:
666
register_command(cmd_test_gtk)
597
670
gettext.install('olive-gtk')