# HG changeset patch
# User Giampaolo Fadel <gp.fa...@gmail.com>
# Date 1244807295 -7200
# Node ID b7f0ee688f8a7ff8bb6a1f7a3955161e8cb0a201
# Parent  21208118da2b04bf4c2dc615bca07c74d4e67601
changeset: highlight the active parent when more than one

useful to understand which parent the other parent button is referring

diff --git a/hggtk/changeset.py b/hggtk/changeset.py
--- a/hggtk/changeset.py
+++ b/hggtk/changeset.py
@@ -146,6 +146,12 @@
         if ctx.branch() != 'default':
             title_line(_('branch:'), ctx.branch(), 'greybg')
         title_line(_('user/date:'), ctx.user() + '\t' + date, 'changeset')
+        
+        if len(ctx.parents()) == 2 and self.parent_toggle.get_active():
+            parentindex = 1 
+        else:
+            parentindex = 0 
+            
         for pctx in ctx.parents():
             try:
                 summary = pctx.description().splitlines()[0]
@@ -155,9 +161,16 @@
             change = str(pctx.rev()) + ' : ' + str(pctx)
             title = _('parent:')
             title += ' ' * (12 - len(title))
-            buf.insert_with_tags_by_name(eob, title, 'parent')
-            buf.insert_with_tags_by_name(eob, change, 'link')
-            buf.insert_with_tags_by_name(eob, ' ' + summary, 'parent')
+
+            if len(ctx.parents()) == 2 and pctx == ctx.parents()[parentindex]:
+                buf.insert_with_tags_by_name(eob, title, 'parenthl')
+                buf.insert_with_tags_by_name(eob, change, 'linkhl')
+                buf.insert_with_tags_by_name(eob, ' ' + summary, 'parenthl')
+            else:
+                buf.insert_with_tags_by_name(eob, title, 'parent')
+                buf.insert_with_tags_by_name(eob, change, 'link')
+                buf.insert_with_tags_by_name(eob, ' ' + summary, 'parent')
+            
             buf.insert(eob, "\n")
         for cctx in ctx.children():
             try:
@@ -416,6 +429,9 @@
                 paragraph_background='#F0F0F0'))
         tag_table.add(make_texttag('parent', foreground='#000090',
                 paragraph_background='#F0F0F0'))
+        tag_table.add(make_texttag('parenthl', foreground='#000090',
+                paragraph_background='#F0F0F0',
+                weight=pango.WEIGHT_BOLD ))
 
         tag_table.add( make_texttag( 'mono', family='Monospace' ))
         tag_table.add( make_texttag( 'blue', foreground='blue' ))
@@ -428,8 +444,13 @@
         tag_table.add( make_texttag( 'yellowbg', background='yellow' ))
         link_tag = make_texttag( 'link', foreground='blue',
                                  underline=pango.UNDERLINE_SINGLE )
+        linkhl_tag = make_texttag( 'linkhl', foreground='blue',
+                                 underline=pango.UNDERLINE_SINGLE,
+                                weight=pango.WEIGHT_BOLD )
         link_tag.connect('event', self.link_event )
+        linkhl_tag.connect('event', self.link_event )
         tag_table.add( link_tag )
+        tag_table.add( linkhl_tag )
 
     def file_button_release(self, widget, event):
         if event.button == 3 and not (event.state & (gtk.gdk.SHIFT_MASK |

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to