[Pkg-bazaar-commits] ./bzr-gtk/unstable r466: Merge Compare With option from Javier.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:50:20 UTC 2009


------------------------------------------------------------
revno: 466
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Fri 2008-04-25 20:41:23 +0100
message:
  Merge Compare With option from Javier.
modified:
  NEWS
  revbrowser.py
  viz/branchwin.py
    ------------------------------------------------------------
    revno: 461.1.3
    committer: Javier Derderian <javierder at gmail.com>
    branch nick: trunk
    timestamp: Thu 2008-04-10 16:39:21 -0300
    message:
      Added "compare with" option to revisions menu.
      Idea taken from bug #7876
    modified:
      dialog.py
      viz/branchwin.py
    ------------------------------------------------------------
    revno: 463.2.1
    committer: Javier Derderian <javierder at gmail.com>
    branch nick: bug.78765
    timestamp: Fri 2008-04-11 17:28:08 -0300
    message:
      Merged from patch
    modified:
      dialog.py
      viz/branchwin.py
    ------------------------------------------------------------
    revno: 463.2.2
    committer: Javier Derderian <javierder at gmail.com>
    branch nick: bug.78765
    timestamp: Fri 2008-04-11 17:34:06 -0300
    message:
      Updated "Compare with..." (#78765) to use revbrowser.RevisionBrowser.
      Also needed to fix #215872 to make it work.
    modified:
      branchview/linegraph.py
      dialog.py
      viz/branchwin.py
    ------------------------------------------------------------
    revno: 463.2.3
    committer: Javier Derderian <javierder at gmail.com>
    branch nick: bug.78765
    timestamp: Mon 2008-04-14 20:45:32 -0300
    message:
      Fixed revbrowser.RevisionBrowser call to TreeView() to pass start revision as list
    modified:
      branchview/linegraph.py
      revbrowser.py
    ------------------------------------------------------------
    revno: 463.2.4
    committer: Javier Derderian <javierder at gmail.com>
    branch nick: bug.78765
    timestamp: Mon 2008-04-14 20:48:47 -0300
    message:
      Fixed revbrowser.RevisionBrowser call to TreeView() to pass start revision as list
    modified:
      branchview/linegraph.py
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2008-04-04 02:34:56 +0000
+++ b/NEWS	2008-04-25 19:41:23 +0000
@@ -26,6 +26,8 @@
 
   * Added enable/disable per-branch option (Martin Albisetti)
 
+  * Add compare with option to revisions menu. (Javier Derderian)
+
  BUG FIXES
 
   * Make adding tags from the viz work again. (Daniel Schierbeck)

=== modified file 'revbrowser.py'
--- a/revbrowser.py	2008-02-14 19:59:06 +0000
+++ b/revbrowser.py	2008-04-25 19:41:23 +0000
@@ -42,7 +42,8 @@
         
         # Create the widgets
         self._button_select = gtk.Button(_("_Select"), use_underline=True)
-        self.treeview = TreeView(branch,branch.last_revision(), None)
+        start_revs = [branch.last_revision(),]
+        self.treeview = TreeView(branch, start_revs, None)
         
         # Set callbacks
         self._button_select.connect('clicked', self._on_select_clicked)

=== modified file 'viz/branchwin.py'
--- a/viz/branchwin.py	2008-04-23 15:19:14 +0000
+++ b/viz/branchwin.py	2008-04-25 19:41:23 +0000
@@ -196,12 +196,17 @@
         revision_menu_diff = gtk.MenuItem("View Changes")
         revision_menu_diff.connect('activate', 
                 lambda w: self.treeview.show_diff())
-
+        
+        revision_menu_compare = gtk.MenuItem("Compare with...")
+        revision_menu_compare.connect('activate',
+                self._compare_with_cb)
+        
         revision_menu_tag = gtk.MenuItem("Tag Revision")
         revision_menu_tag.connect('activate', self._tag_revision_cb)
 
         revision_menu.add(revision_menu_tag)
         revision_menu.add(revision_menu_diff)
+        revision_menu.add(revision_menu_compare)
 
         branch_menu = gtk.Menu()
         branch_menuitem = gtk.MenuItem("_Branch")
@@ -378,6 +383,22 @@
         self.show_diff(revid, parentid)
         self.treeview.grab_focus()
 
+    def _compare_with_cb(self,w):
+        """Callback for revision 'compare with' menu. Will show a small
+            dialog with branch revisions to compare with selected revision in TreeView"""
+        
+        from bzrlib.plugins.gtk.revbrowser import RevisionBrowser
+        
+        rb = RevisionBrowser(self.branch,self)
+        ret = rb.run()
+        
+        if ret == gtk.RESPONSE_OK:          
+            (path, focus) = self.treeview.treeview.get_cursor()
+            revid = self.treeview.model[path][treemodel.REVID]
+            self.show_diff(revid, rb.selected_revid)
+            
+        rb.destroy()
+            
     def _set_revision_cb(self, w, revision_id):
         self.treeview.set_revision_id(revision_id)
 



More information about the Pkg-bazaar-commits mailing list