diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2012-11-04 03:13:27 +0100 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2012-11-04 08:35:20 -0500 |
commit | ff247d9e56366a3b03d8ca926fd88b51d3c2df52 (patch) | |
tree | 5fd5d922e40a26d2a31ad053517bdadcc65c9815 /contrib/remote-helpers/git-remote-hg | |
parent | remote-hg: add support to push URLs (diff) | |
download | tgif-ff247d9e56366a3b03d8ca926fd88b51d3c2df52.tar.xz |
remote-hg: make sure the encoding is correct
Independently of the environment.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'contrib/remote-helpers/git-remote-hg')
-rwxr-xr-x | contrib/remote-helpers/git-remote-hg | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index a5023c92fa..503a9fc324 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -9,7 +9,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 @@ -391,6 +391,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] @@ -409,6 +412,8 @@ def do_import(parser): parser.next() + encoding.encoding = tmp + print 'done' def parse_blob(parser): @@ -491,8 +496,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 |