add a menu entry to tree diff context menu to
select the common ancestor between two
selected revisions.


# HG changeset patch
# User Emmanuel Rosa <[email protected]>
# Date 1257648174 18000
# Branch stable
# Node ID ca582790c681866b05f443fb49d6023e556de189
# Parent  f6020969396e04db895c634359d92e571729db28
history: menu entry to select common ancestor

add a menu entry to tree diff context menu to
select the common ancestor between two
selected revisions.

diff --git a/tortoisehg/hgtk/history.py b/tortoisehg/hgtk/history.py
--- a/tortoisehg/hgtk/history.py
+++ b/tortoisehg/hgtk/history.py
@@ -824,6 +824,10 @@
             m.append(create_menu(_('qimport from here to selected'),
                      self.qimport_revs))
 
+        m.append_sep()
+        m.append(create_menu(_('Select common ancestor revision'),
+            self.select_common_ancestor))
+
         menu = m.create_menu()
         menu.connect_after('selection-done', self.restore_single_sel)
         menu.show_all()
@@ -1874,6 +1878,14 @@
         self.reload_log()
         self.changeview.clear()
 
+    def select_common_ancestor(self, menuitem):
+        rev1, rev2 = self.revrange
+        changelog = self.repo.changelog
+        lookup = self.repo.lookup
+        ancestor = changelog.ancestor(lookup(rev1), lookup(rev2))
+        rev = changelog.rev(ancestor)
+        self.graphview.set_revision_id(rev, True)
+
     def thgrefresh(self, window):
         self.reload_log()
 
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to