[PATCH 7 of 8] fixed stringify() to accept Unicode strings
Andrey
grooz-work at gorodok.net
Mon Nov 20 10:29:57 UTC 2006
# HG changeset patch
# User Andrey <grooz-work at gorodok.net>
# Date 1164018924 -21600
# Node ID 02aa0b1fd22e78ab0697637cdc840aaccb4c2539
# Parent 8abdf624d13d18b6daf2f1675b6ef555c7892fcb
fixed stringify() to accept Unicode strings
(transplanted from e92ddb1b64fb06361af6bfb0651a079c507a6c51)
diff -r 8abdf624d13d -r 02aa0b1fd22e mercurial/templater.py
--- a/mercurial/templater.py Tue Nov 14 08:32:38 2006 +0600
+++ b/mercurial/templater.py Mon Nov 20 16:35:24 2006 +0600
@@ -157,6 +157,7 @@ def stringify(thing):
'''turn nested template iterator into string.'''
if hasattr(thing, '__iter__'):
return "".join([stringify(t) for t in thing if t is not None])
+ if isinstance(thing, unicode): return thing
return str(thing)
para_re = None
More information about the Mercurial-devel
mailing list