# HG changeset patch
# User Yuki KODAMA <[email protected]>
# Date 1243051135 -32400
# Node ID 9d1d3a273711ff21b9c789b5166d1200e77739e3
# Parent  98be5bcd15dff74d5796b10050fd586011509916
thgconfig: change utf-8 '<unspecified>' to local encoded one

This fix will prevent to write out all unspecified values
to Mercurial.ini file.

diff --git a/hggtk/thgconfig.py b/hggtk/thgconfig.py
--- a/hggtk/thgconfig.py
+++ b/hggtk/thgconfig.py
@@ -19,6 +19,7 @@
 from hggtk import dialog, gdialog, gtklib, hgcmd

 _unspecstr = _('<unspecified>')
+_unspeclocalstr = hglib.fromutf(_unspecstr)

 _pwfields = ('http_proxy.passwd', 'smtp.password')

@@ -916,8 +917,9 @@
         return iniparse.INIConfig(file(fn), optionxformvalue=None)

     def record_new_value(self, cpath, newvalue, keephistory=True):
+        # 'newvalue' is converted to local encoding
         section, key = cpath.split('.', 1)
-        if newvalue == _unspecstr or newvalue == '':
+        if newvalue == _unspeclocalstr or newvalue == '':
             try:
                 del self.ini[section][key]
             except KeyError:

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to