[GTK/MERGE] Some improvements
Robert Collins
robertc at robertcollins.net
Thu Jul 5 06:08:36 BST 2007
This improves the help for bzr-gtk -
$ bzr help gtk
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.
And also adds an 'inspect' button to commit-notify - click and get bzr
viz on that branch/revision.
-Rob
diff follows branch up at
http://bazaar.launchpad.net/~lifeless/bzr-gtk/misc
# Bazaar revision bundle v0.9
#
# message:
# Add inspect window to bzr commity-notify.
# committer: Robert Collins <robertc at robertcollins.net>
# date: Thu 2007-07-05 15:01:53.428999901 +1000
=== modified file __init__.py
--- __init__.py
+++ __init__.py
@@ -12,7 +12,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
@@ -194,6 +211,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.
@@ -214,7 +245,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()
@@ -223,16 +253,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()
@@ -498,6 +524,11 @@
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()
+ nw.add_action("clicked", "Inspect", start_viz, None)
nw.set_timeout(5000)
nw.show()
except Exception, e:
=== modified directory //
last-changed:robertc at robertcollins.net-2007070505015
... 3-o5j4t7fkxe66fbht
# revision id: robertc at robertcollins.net-20070705050153-o5j4t7fkxe66fbht
# sha1: 54973b6646322e8282da404b806f7c2d660471c4
# inventory sha1: 5fe165308ea68b9507cea5be0dce6da1e832f1b1
# parent ids:
# robertc at robertcollins.net-20070705042700-cw2buapcxrctkeya
# base id: dato at net.com.org.es-20070703221926-agtx1dc3h1bkg19o
# properties:
# branch-nick: trunk
# message:
# Better module docstring.
# committer: Robert Collins <robertc at robertcollins.net>
# date: Thu 2007-07-05 14:27:00.247999907 +1000
=== modified file __init__.py // encoding:base64
LS0tIF9faW5pdF9fLnB5CisrKyBfX2luaXRfXy5weQpAQCAtMTIsNyArMTIsMjQgQEAKICMgYWxv
bmcgd2l0aCB0aGlzIHByb2dyYW07IGlmIG5vdCwgd3JpdGUgdG8gdGhlIEZyZWUgU29mdHdhcmUK
ICMgRm91bmRhdGlvbiwgSW5jLiwgNTkgVGVtcGxlIFBsYWNlLCBTdWl0ZSAzMzAsIEJvc3Rvbiwg
TUEgIDAyMTExLTEzMDcgIFVTQQogCi0iIiJHVEsrIGZyb250ZW5kcyB0byBCYXphYXIgY29tbWFu
ZHMgIiIiCisiIiJHcmFwaGljYWwgc3VwcG9ydCBmb3IgQmF6YWFyIHVzaW5nIEdUSy4KKworVGhp
cyBwbHVnaW4gaW5jbHVkZXM6Citjb21taXQtbm90aWZ5ICAgICBTdGFydCB0aGUgZ3JhcGhpY2Fs
IG5vdGlmaWVyIG9mIGNvbW1pdHMuCitnYW5ub3RhdGUgICAgICAgICBHVEsrIGFubm90YXRlLiAK
K2dicmFuY2ggICAgICAgICAgIEdUSysgYnJhbmNoaW5nLiAKK2djaGVja291dCAgICAgICAgIEdU
SysgY2hlY2tvdXQuIAorZ2NvbW1pdCAgICAgICAgICAgR1RLKyBjb21taXQgZGlhbG9nIAorZ2Nv
bmZsaWN0cyAgICAgICAgR1RLKyBwdXNoLiAKK2dkaWZmICAgICAgICAgICAgIFNob3cgZGlmZmVy
ZW5jZXMgaW4gd29ya2luZyB0cmVlIGluIGEgR1RLKyBXaW5kb3cuIAorZ2luaXQgICAgICAgICAg
ICAgSW5pdGlhbGlzZSBhIG5ldyBicmFuY2guCitnbWlzc2luZyAgICAgICAgICBHVEsrIG1pc3Np
bmcgcmV2aXNpb25zIGRpYWxvZy4gCitncHJlZmVyZW5jZXMgICAgICBHVEsrIHByZWZlcmVuY2Vz
IGRpYWxvZy4gCitncHVzaCAgICAgICAgICAgICBHVEsrIHB1c2guIAorZ3N0YXR1cyAgICAgICAg
ICAgR1RLKyBzdGF0dXMgZGlhbG9nIAorZ3RhZ3MgICAgICAgICAgICAgTWFuYWdlIGJyYW5jaCB0
YWdzLgordmlzdWFsaXNlICAgICAgICAgR3JhcGhpY2FsbHkgdmlzdWFsaXNlIHRoaXMgYnJhbmNo
LiAKKyIiIgogCiBpbXBvcnQgYnpybGliCiAKCg==
=== modified directory //
last-changed:robertc at robertcollins.net-2007070504270
... 0-cw2buapcxrctkeya
# revision id: robertc at robertcollins.net-20070705042700-cw2buapcxrctkeya
# sha1: 79944e5686f5065ab283c399ed901ddae5497e3d
# inventory sha1: 2a62951347831391f7f8c4ea3ef0da25b586b483
# parent ids:
# dato at net.com.org.es-20070703221926-agtx1dc3h1bkg19o
# properties:
# branch-nick: trunk
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070705/ebc757ef/attachment.pgp
More information about the bazaar
mailing list