# HG changeset patch
# User Henrik Stuart <h...@hstuart.dk>
# Date 1253993645 -7200
# Node ID c69940e138209ee89414a227f5b15c8408e763f7
# Parent  ed864cd7d9e9338fbe06afe41b8278285e87396e
changeset: compute number of spaces from unicode string

In localised versions, the layout of the changeset would be all garbled, if
individual keys contained non-ascii characters.

diff -r ed864cd7d9e9 -r c69940e13820 tortoisehg/hgtk/changeset.py
--- a/tortoisehg/hgtk/changeset.py      Sat Sep 26 21:18:30 2009 +0200
+++ b/tortoisehg/hgtk/changeset.py      Sat Sep 26 21:34:05 2009 +0200
@@ -16,7 +16,7 @@
 
 from tortoisehg.util.i18n import _
 from tortoisehg.util.hglib import *
-from tortoisehg.util import shlib
+from tortoisehg.util import shlib, hglib
 
 from tortoisehg.hgtk import gdialog, gtklib, hgcmd
 
@@ -212,7 +212,8 @@
         buf, rev = self._buffer, self.currev
 
         def pad_right(text):
-            return text + ' ' * (12 - len(text))
+            spaces = ' ' * (12 - len(hglib.tounicode(text)))
+            return text + spaces
 
         def title_line(title, text, tag):
             utext = toutf(pad_right(title) + text)

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; 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&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to