/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: Jelmer Vernooij
  • Date: 2007-03-20 19:36:35 UTC
  • Revision ID: jelmer@samba.org-20070320193635-9fa36baqqfb30de8
Add very simple gmissing command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
443
443
 
444
444
register_command(cmd_gpreferences)
445
445
 
 
446
 
 
447
class cmd_gmissing(Command):
 
448
    """ GTK+ missing revisions dialog.
 
449
 
 
450
    """
 
451
    takes_args = ["other_branch?"]
 
452
    def run(self, other_branch=None):
 
453
        pygtk = import_pygtk()
 
454
        try:
 
455
            import gtk
 
456
        except RuntimeError, e:
 
457
            if str(e) == "could not open display":
 
458
                raise NoDisplayError
 
459
 
 
460
        from bzrlib.plugins.gtk.missing import MissingWindow
 
461
        from bzrlib.branch import Branch
 
462
 
 
463
        local_branch = Branch.open_containing(".")[0]
 
464
        if other_branch is None:
 
465
            other_branch = local_branch.get_parent()
 
466
            
 
467
            if other_branch is None:
 
468
                raise errors.BzrCommandError("No peer location known or specified.")
 
469
        remote_branch = Branch.open_containing(other_branch)[0]
 
470
        set_ui_factory()
 
471
        local_branch.lock_read()
 
472
        try:
 
473
            remote_branch.lock_read()
 
474
            try:
 
475
                dialog = MissingWindow(local_branch, remote_branch)
 
476
                dialog.run()
 
477
            finally:
 
478
                remote_branch.unlock()
 
479
        finally:
 
480
            local_branch.unlock()
 
481
 
 
482
register_command(cmd_gmissing)
 
483
 
446
484
import gettext
447
485
gettext.install('olive-gtk')
448
486