[Pkg-bazaar-commits] ./bzr-gtk/unstable r216: Merge upstream.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:49:26 UTC 2009


------------------------------------------------------------
revno: 216
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sat 2007-07-14 01:13:17 +0300
message:
  Merge upstream.
modified:
  TODO
  __init__.py
  branch.py
  setup.py
    ------------------------------------------------------------
    revno: 208.2.1
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: trunk
    timestamp: Thu 2007-07-05 14:27:00 +1000
    message:
      Better module docstring.
    modified:
      __init__.py
    ------------------------------------------------------------
    revno: 208.2.2
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: trunk
    timestamp: Thu 2007-07-05 15:01:53 +1000
    message:
      Add inspect window to bzr commity-notify.
    modified:
      __init__.py
    ------------------------------------------------------------
    revno: 208.2.3
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: trunk
    timestamp: Sun 2007-07-08 08:02:45 +1000
    message:
      Add a Branch button to commit-notify.
    modified:
      TODO
      __init__.py
      branch.py
    ------------------------------------------------------------
    revno: 208.2.4
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: trunk
    timestamp: Sun 2007-07-08 11:43:58 +1000
    message:
      Unbreak inspect of commits due to misunderstanding of pynotify api.
    modified:
      __init__.py
    ------------------------------------------------------------
    revno: 208.2.5
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: trunk
    timestamp: Thu 2007-07-12 15:38:02 +1000
    message:
      Change version to 0.18.
    modified:
      __init__.py
    ------------------------------------------------------------
    revno: 208.2.6
    committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
    branch nick: trunk
    timestamp: Thu 2007-07-12 14:32:53 +0200
    message:
      Bump the version number in the setup script as well.
    modified:
      setup.py
    ------------------------------------------------------------
    revno: 208.2.7
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: gtk
    timestamp: Thu 2007-07-12 17:34:47 +0200
    message:
      Fix option help strings to comply with the style guide.
    modified:
      __init__.py
-------------- next part --------------
=== modified file 'TODO'
--- a/TODO	2007-03-23 13:41:56 +0000
+++ b/TODO	2007-07-07 22:02:45 +0000
@@ -15,3 +15,7 @@
 - Ability to bind/unbind the branch
 - List Bzr options in context menu in a way that makes sense (alphabetically?)
 - Allow specifying two revisions in the diff window rather then always diffing between base and working tree
+- For performance BranchDialog should only open each url once. Once opened it
+  should keep a read lock open and only release this when the url is changed.
+  It should also allow the creator of the window to supply an already opened
+  branch, and a revision id.

=== modified file '__init__.py'
--- a/__init__.py	2007-07-13 20:34:04 +0000
+++ b/__init__.py	2007-07-13 22:13:17 +0000
@@ -14,7 +14,24 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-"""GTK+ frontends to Bazaar commands """
+"""Graphical support for Bazaar using GTK.
+
+This plugin includes:
+commit-notify     Start the graphical notifier of commits.
+gannotate         GTK+ annotate. 
+gbranch           GTK+ branching. 
+gcheckout         GTK+ checkout. 
+gcommit           GTK+ commit dialog 
+gconflicts        GTK+ push. 
+gdiff             Show differences in working tree in a GTK+ Window. 
+ginit             Initialise a new branch.
+gmissing          GTK+ missing revisions dialog. 
+gpreferences      GTK+ preferences dialog. 
+gpush             GTK+ push. 
+gstatus           GTK+ status dialog 
+gtags             Manage branch tags.
+visualise         Graphically visualise this branch. 
+"""
 
 import bzrlib
 
@@ -196,6 +213,20 @@
             wt.unlock()
 
 
+def start_viz_window(branch, revision, limit=None):
+    """Start viz on branch with revision revision.
+    
+    :return: The viz window object.
+    """
+    from viz.branchwin import BranchWindow
+    branch.lock_read()
+    pp = BranchWindow()
+    pp.set_branch(branch, revision, limit)
+    # cleanup locks when the window is closed
+    pp.connect("destroy", lambda w: branch.unlock())
+    return pp
+
+
 class cmd_visualise(Command):
     """Graphically visualise this branch.
 
@@ -207,7 +238,7 @@
     """
     takes_options = [
         "revision",
-        Option('limit', "maximum number of revisions to display",
+        Option('limit', "Maximum number of revisions to display.",
                int, 'count')]
     takes_args = [ "location?" ]
     aliases = [ "visualize", "vis", "viz" ]
@@ -216,7 +247,6 @@
         set_ui_factory()
         (br, path) = branch.Branch.open_containing(location)
         br.lock_read()
-        br.repository.lock_read()
         try:
             if revision is None:
                 revid = br.last_revision()
@@ -225,16 +255,12 @@
             else:
                 (revno, revid) = revision[0].in_history(br)
 
-            from viz.branchwin import BranchWindow
             import gtk
-                
-            pp = BranchWindow()
-            pp.set_branch(br, revid, limit)
+            pp = start_viz_window(br, revid, limit)
             pp.connect("destroy", lambda w: gtk.main_quit())
             pp.show()
             gtk.main()
         finally:
-            br.repository.unlock()
             br.unlock()
 
 
@@ -246,10 +272,10 @@
 
     takes_args = ["filename", "line?"]
     takes_options = [
-        Option("all", help="show annotations on all lines"),
-        Option("plain", help="don't highlight annotation lines"),
+        Option("all", help="Show annotations on all lines."),
+        Option("plain", help="Don't highlight annotation lines."),
         Option("line", type=int, argname="lineno",
-               help="jump to specified line number"),
+               help="Jump to specified line number."),
         "revision",
     ]
     aliases = ["gblame", "gpraise"]
@@ -506,6 +532,17 @@
                 body += revision.message
                 body = cgi.escape(body)
                 nw = pynotify.Notification(summary, body)
+                def start_viz(notification=None, action=None, data=None):
+                    """Start the viz program."""
+                    pp = start_viz_window(branch, revision_id)
+                    pp.show()
+                def start_branch(notification=None, action=None, data=None):
+                    """Start a Branch dialog"""
+                    from bzrlib.plugins.gtk.branch import BranchDialog
+                    bd = BranchDialog(remote_path=url)
+                    bd.run()
+                nw.add_action("inspect", "Inspect", start_viz, None)
+                nw.add_action("branch", "Branch", start_branch, None)
                 nw.set_timeout(5000)
                 nw.show()
             except Exception, e:

=== modified file 'branch.py'
--- a/branch.py	2007-05-17 16:12:27 +0000
+++ b/branch.py	2007-07-07 22:02:45 +0000
@@ -37,6 +37,7 @@
 
 class BranchDialog(gtk.Dialog):
     """ New implementation of the Branch dialog. """
+
     def __init__(self, path=None, parent=None, remote_path=None):
         """ Initialize the Branch dialog. """
         gtk.Dialog.__init__(self, title="Branch - Olive",

=== modified file 'setup.py'
--- a/setup.py	2007-06-10 15:54:57 +0000
+++ b/setup.py	2007-07-12 12:32:53 +0000
@@ -63,7 +63,7 @@
 
 setup(
     name = "bzr-gtk",
-    version = "0.17.0",
+    version = "0.18.0",
     maintainer = "Jelmer Vernooij",
     maintainer_email = "jelmer at samba.org",
     description = "GTK+ Frontends for various Bazaar commands",



More information about the Pkg-bazaar-commits mailing list