From: Felipe Contreras Date: Sun, 28 Oct 2012 03:54:06 GMT Subject: [PATCH v4 06/13] remote-hg: make sure the encoding is correct Message-ID: <1351396453-29042-7-git-send-email-felipe.contreras@gmail.com> In-Reply-To: <1351396453-29042-1-git-send-email-felipe.contreras@gmail.com> Independently of the environment. Signed-off-by: Felipe Contreras --- contrib/remote-hg/git-remote-hg | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/contrib/remote-hg/git-remote-hg b/contrib/remote-hg/git-remote-hg index c96e1a8..1689573 100755 --- a/contrib/remote-hg/git-remote-hg +++ b/contrib/remote-hg/git-remote-hg @@ -6,7 +6,7 @@ # Then you can clone with: # git clone hg::/path/to/mercurial/repo/ -from mercurial import hg, ui, bookmarks, context, util +from mercurial import hg, ui, bookmarks, context, util, encoding import re import sys @@ -370,6 +370,9 @@ def do_import(parser): print "feature export-marks=%s" % path sys.stdout.flush() + tmp = encoding.encoding + encoding.encoding = 'utf-8' + # lets get all the import lines while parser.check('import'): ref = parser[1] @@ -388,6 +391,8 @@ def do_import(parser): parser.next() + encoding.encoding = tmp + print 'done' def parse_blob(parser): @@ -471,8 +476,13 @@ def parse_commit(parser): files.keys(), getfilectx, user, (date, tz), extra) + tmp = encoding.encoding + encoding.encoding = 'utf-8' + node = repo.commitctx(ctx) + encoding.encoding = tmp + rev = repo[node].rev() parsed_refs[ref] = node -- 1.8.0