Skip to content

Commit 583736c

Browse files
committed
Merge branch 'ap/remote-hg-unquote-cquote'
A fast-import stream expresses a pathname with funny characters by quoting them in C style; remote-hg remote helper forgot to unquote such a path. * ap/remote-hg-unquote-cquote: remote-hg: unquote C-style paths when exporting
2 parents 9dd860c + 1136265 commit 583736c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

contrib/remote-helpers/git-remote-hg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,11 @@ def get_merge_files(repo, p1, p2, files):
703703
f = { 'ctx' : repo[p1][e] }
704704
files[e] = f
705705

706+
def c_style_unescape(string):
707+
if string[0] == string[-1] == '"':
708+
return string.decode('string-escape')[1:-1]
709+
return string
710+
706711
def parse_commit(parser):
707712
from_mark = merge_mark = None
708713

@@ -742,6 +747,7 @@ def parse_commit(parser):
742747
f = { 'deleted' : True }
743748
else:
744749
die('Unknown file command: %s' % line)
750+
path = c_style_unescape(path).decode('utf-8')
745751
files[path] = f
746752

747753
# only export the commits if we are on an internal proxy repo

0 commit comments

Comments
 (0)