/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Daniel Schierbeck
  • Date: 2007-11-07 14:19:09 UTC
  • mfrom: (330.3.5 trunk)
  • Revision ID: daniel.schierbeck@gmail.com-20071107141909-3zxf7nw5laldvfxi
Merged with mainline.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
visualise         Graphically visualise this branch. 
33
33
"""
34
34
 
 
35
import sys
 
36
 
35
37
import bzrlib
36
38
 
37
 
version_info = (0, 92, 0, 'dev', 0)
 
39
version_info = (0, 93, 0, 'dev', 0)
38
40
 
39
41
if version_info[3] == 'final':
40
42
    version_string = '%d.%d.%d' % version_info[:3]
332
334
    """GTK+ commit dialog
333
335
 
334
336
    Graphical user interface for committing revisions"""
335
 
    
 
337
 
336
338
    aliases = [ "gci" ]
337
339
    takes_args = []
338
340
    takes_options = []
351
353
            (wt, path) = workingtree.WorkingTree.open_containing(filename)
352
354
            br = wt.branch
353
355
        except NoWorkingTree, e:
354
 
            path = e.base
355
 
            (br, path) = branch.Branch.open_containing(path)
356
 
 
357
 
        commit = CommitDialog(wt, path, not br)
358
 
        commit.run()
359
 
 
 
356
            from dialog import error_dialog
 
357
            error_dialog(_('Directory does not have a working tree'),
 
358
                         _('Operation aborted.'))
 
359
            return 1 # should this be retval=3?
 
360
 
 
361
        # It is a good habit to keep things locked for the duration, but it
 
362
        # could cause difficulties if someone wants to do things in another
 
363
        # window... We could lock_read() until we actually go to commit
 
364
        # changes... Just a thought.
 
365
        wt.lock_write()
 
366
        try:
 
367
            dlg = CommitDialog(wt)
 
368
            return dlg.run()
 
369
        finally:
 
370
            wt.unlock()
360
371
 
361
372
 
362
373
class cmd_gstatus(GTKCommand):
608
619
register_command(cmd_gselftest)
609
620
 
610
621
 
 
622
class cmd_test_gtk(GTKCommand):
 
623
    """Version of selftest that just runs the gtk test suite."""
 
624
 
 
625
    takes_options = ['verbose',
 
626
                     Option('one', short_name='1',
 
627
                            help='stop when one test fails'),
 
628
                     Option('benchmark', help='run the benchmarks.'),
 
629
                     Option('lsprof-timed',
 
630
                     help='generate lsprof output for benchmarked'
 
631
                          ' sections of code.'),
 
632
                     Option('list-only',
 
633
                     help='list the tests instead of running them'),
 
634
                     Option('randomize', type=str, argname="SEED",
 
635
                     help='randomize the order of tests using the given'
 
636
                          ' seed or "now" for the current time'),
 
637
                    ]
 
638
    takes_args = ['testspecs*']
 
639
 
 
640
    def run(self, verbose=None, one=False, benchmark=None,
 
641
            lsprof_timed=None, list_only=False, randomize=None,
 
642
            testspecs_list=None):
 
643
        from bzrlib import __path__ as bzrlib_path
 
644
        from bzrlib.tests import selftest
 
645
 
 
646
        print '%10s: %s' % ('bzrlib', bzrlib_path[0])
 
647
        if benchmark:
 
648
            print 'No benchmarks yet'
 
649
            return 3
 
650
 
 
651
            test_suite_factory = bench_suite
 
652
            if verbose is None:
 
653
                verbose = True
 
654
            # TODO: should possibly lock the history file...
 
655
            benchfile = open(".perf_history", "at", buffering=1)
 
656
        else:
 
657
            test_suite_factory = test_suite
 
658
            if verbose is None:
 
659
                verbose = False
 
660
            benchfile = None
 
661
 
 
662
        if testspecs_list is not None:
 
663
            pattern = '|'.join(testspecs_list)
 
664
        else:
 
665
            pattern = ".*"
 
666
 
 
667
        try:
 
668
            result = selftest(verbose=verbose,
 
669
                              pattern=pattern,
 
670
                              stop_on_failure=one,
 
671
                              test_suite_factory=test_suite_factory,
 
672
                              lsprof_timed=lsprof_timed,
 
673
                              bench_history=benchfile,
 
674
                              list_only=list_only,
 
675
                              random_seed=randomize,
 
676
                             )
 
677
        finally:
 
678
            if benchfile is not None:
 
679
                benchfile.close()
 
680
 
 
681
register_command(cmd_test_gtk)
 
682
 
 
683
 
611
684
import gettext
612
685
gettext.install('olive-gtk')
613
686