[PATCH 3 of 9] convert/gnuarch: set prefered locale for str conversions

Edouard Gomez ed.gomez at free.fr
Sat Jan 3 19:37:12 CST 2009


# HG changeset patch
# User Edouard Gomez <ed.gomez at free.fr>
# Date 1231033008 -3600
# Node ID 737ce860ff2f94a3ba5a132b5b37f55cc2c78b4e
# Parent  c8ea23b85da5dcd27348b096a12a4574fcdd4293
convert/gnuarch: set prefered locale for str conversions

Seems necessary, as a test on my archives goes further with this.

diff --git a/hgext/convert/gnuarch.py b/hgext/convert/gnuarch.py
--- a/hgext/convert/gnuarch.py
+++ b/hgext/convert/gnuarch.py
@@ -3,7 +3,7 @@
 from common import NoRepo, commandline, commit, converter_source
 from mercurial.i18n import _
 from mercurial import util
-import os, shutil, tempfile, stat
+import os, shutil, tempfile, stat, locale
 from email.Parser import Parser
 
 class gnuarch_source(converter_source, commandline):
@@ -48,6 +48,7 @@
         self.tags = {}
         self.modecache = {}
         self.catlogparser = Parser()
+        self.locale = locale.getpreferredencoding()
 
     def before(self):
         if self.execmd == 'tla':


More information about the Mercurial-devel mailing list