Skip to content

Commit 4bc3d3f

Browse files
committed
Merge branch 'ap/remote-hg-unquote-cquote' into maint
A fast-import stream expresses a pathname with funny characters by quoting them in C style; remote-hg remote helper (in contrib/) forgot to unquote such a path. * ap/remote-hg-unquote-cquote: remote-hg: unquote C-style paths when exporting
2 parents 9196a2f + 1136265 commit 4bc3d3f

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
@@ -678,6 +678,11 @@ def get_merge_files(repo, p1, p2, files):
678678
f = { 'ctx' : repo[p1][e] }
679679
files[e] = f
680680

681+
def c_style_unescape(string):
682+
if string[0] == string[-1] == '"':
683+
return string.decode('string-escape')[1:-1]
684+
return string
685+
681686
def parse_commit(parser):
682687
global marks, blob_marks, parsed_refs
683688
global mode
@@ -720,6 +725,7 @@ def parse_commit(parser):
720725
f = { 'deleted' : True }
721726
else:
722727
die('Unknown file command: %s' % line)
728+
path = c_style_unescape(path).decode('utf-8')
723729
files[path] = f
724730

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

0 commit comments

Comments
 (0)