# HG changeset patch
# User Yuki KODAMA <endflow....@gmail.com>
# Date 1256731040 -32400
# Branch stable
# Node ID a09cb9eeba90f22cbc5a7ff305e8fef5d7584688
# Parent  8aaab473dcbb52100d382de36f685b5976ff8400
changeset: fix parent/child widgets when shown a patch

diff --git a/tortoisehg/hgtk/changeset.py b/tortoisehg/hgtk/changeset.py
--- a/tortoisehg/hgtk/changeset.py
+++ b/tortoisehg/hgtk/changeset.py
@@ -454,14 +454,16 @@
                 parents = []
                 for pctx in pctxs:
                     highlight = len(pctxs) == 2 and pctx == pctxs[pindex]
-                    branch = pctx.branch() != ctx.branch() and
pctx.branch() or None
+                    branch = None
+                    if hasattr(pctx, 'branch') and pctx.branch() !=
ctx.branch():
+                        branch = pctx.branch()
                     parents.append(revline_data(pctx, highlight, branch))
                 return parents
             elif item == 'children':
                 children = []
                 for cctx in ctx.children():
                     branch = None
-                    if cctx.branch() != ctx.branch():
+                    if hasattr(cctx, 'branch') and cctx.branch() !=
ctx.branch():
                         branch = cctx.branch()
                     children.append(revline_data(cctx, branch=branch))
                 return children
@@ -540,12 +542,19 @@
                 box.pack_start(link, False, False)
                 box.pack_start(text, True, True, 4)
                 return box
+            def genwidget(param):
+                if isinstance(param, basestring):
+                    label = gtk.Label()
+                    label.set_markup(param)
+                    label.set_selectable(True)
+                    return label
+                return linkwidget(*param)
             if item in ('parents', 'children'):
                 csets = widget.get_data(item)
-                return [linkwidget(*cset) for cset in csets]
+                return [genwidget(cset) for cset in csets]
             elif item == 'transplant':
                 cset = widget.get_data(item)
-                return linkwidget(*cset)
+                return genwidget(cset)
             raise csinfo.UnknownItem(item)

         custom = csinfo.custom(data=data_func, label=label_func,

Attachment: thg-kuy_rev4806.patch
Description: Binary data

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to