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>
This commit is contained in:
parent
ffaf84c663
commit
ff247d9e56
@ -9,7 +9,7 @@
|
|||||||
# Then you can clone with:
|
# Then you can clone with:
|
||||||
# git clone hg::/path/to/mercurial/repo/
|
# 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 re
|
||||||
import sys
|
import sys
|
||||||
@ -391,6 +391,9 @@ def do_import(parser):
|
|||||||
print "feature export-marks=%s" % path
|
print "feature export-marks=%s" % path
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
tmp = encoding.encoding
|
||||||
|
encoding.encoding = 'utf-8'
|
||||||
|
|
||||||
# lets get all the import lines
|
# lets get all the import lines
|
||||||
while parser.check('import'):
|
while parser.check('import'):
|
||||||
ref = parser[1]
|
ref = parser[1]
|
||||||
@ -409,6 +412,8 @@ def do_import(parser):
|
|||||||
|
|
||||||
parser.next()
|
parser.next()
|
||||||
|
|
||||||
|
encoding.encoding = tmp
|
||||||
|
|
||||||
print 'done'
|
print 'done'
|
||||||
|
|
||||||
def parse_blob(parser):
|
def parse_blob(parser):
|
||||||
@ -491,8 +496,13 @@ def parse_commit(parser):
|
|||||||
files.keys(), getfilectx,
|
files.keys(), getfilectx,
|
||||||
user, (date, tz), extra)
|
user, (date, tz), extra)
|
||||||
|
|
||||||
|
tmp = encoding.encoding
|
||||||
|
encoding.encoding = 'utf-8'
|
||||||
|
|
||||||
node = repo.commitctx(ctx)
|
node = repo.commitctx(ctx)
|
||||||
|
|
||||||
|
encoding.encoding = tmp
|
||||||
|
|
||||||
rev = repo[node].rev()
|
rev = repo[node].rev()
|
||||||
|
|
||||||
parsed_refs[ref] = node
|
parsed_refs[ref] = node
|
||||||
|
Loading…
Reference in New Issue
Block a user