Source

thg-qt-mq / rebase-svn-unicode-try.diff

Full commit
# HG changeset patch
# Parent 3cabbc71f95b14a6338718a9ece8fb8b96775d9a
diff --git a/tortoisehg/hgqt/csinfo.py b/tortoisehg/hgqt/csinfo.py
--- a/tortoisehg/hgqt/csinfo.py
+++ b/tortoisehg/hgqt/csinfo.py
@@ -193,7 +193,7 @@ class SummaryInfo(object):
                 return p4cl and ('changelist %s' % p4cl)
             elif item == 'svn':
                 extra = ctx.extra()
-                cvt = extra.get('convert_revision', '')
+                cvt = hglib.tounicode(extra.get('convert_revision', ''))
                 if cvt.startswith('svn:'):
                     result = cvt.split('/', 1)[-1]
                     if cvt != result:
@@ -207,6 +207,7 @@ class SummaryInfo(object):
             raise UnknownItem(item)
         if 'data' in custom and not kargs.get('usepreset', False):
             try:
+                print [widget, item, ctx]
                 return custom['data'](widget, item, ctx)
             except UnknownItem:
                 pass
@@ -250,7 +251,7 @@ class SummaryInfo(object):
             elif item in ('revid', 'transplant'):
                 return qtlib.markup(value, **mono)
             elif item in ('revnum', 'p4', 'svn', 'close'):
-                return str(value)
+                return unicode(value)
             elif item in ('rawbranch', 'branch'):
                 opts = dict(fg='black', bg='#aaffaa')
                 return qtlib.markup(' %s ' % value, **opts)
@@ -411,6 +412,7 @@ class SummaryPanel(SummaryBase, QWidget)
             label = qtlib.markup(self.get_label(item), weight='bold')
             if isinstance(markups, basestring):
                 markups = [markups,]
+            print repr(label), repr(markups[0])
             buf += PANEL_TMPL % (label, markups.pop(0))
             for markup in markups:
                 buf += PANEL_TMPL % (' ', markup)
diff --git a/tortoisehg/hgqt/revpanel.py b/tortoisehg/hgqt/revpanel.py
--- a/tortoisehg/hgqt/revpanel.py
+++ b/tortoisehg/hgqt/revpanel.py
@@ -72,6 +72,8 @@ def data_func(widget, item, ctx):
         ts = widget.get_data(item, usepreset=True)
         if not ts:
             return None
+        if item == 'svn':
+            return ts  # XXX
         try:
             tctx = ctx._repo[ts]
             return revline_data(tctx)