aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-11-08 12:01:13 -0800
committerJunio C Hamano <gitster@pobox.com>2013-11-08 12:01:14 -0800
commit4bc3d3fca0cb3a7845c7b15c7a7649a1202254b4 (patch)
tree1112db59ffa64171f943c5452081f167bbecee13
parent9196a2f8bd46d36a285bdfa03b4540ed3f01f671 (diff)
parent113626537711e290af46548683e02ae0a2f51b6f (diff)
downloadgit-4bc3d3fca0cb3a7845c7b15c7a7649a1202254b4.tar.gz
git-4bc3d3fca0cb3a7845c7b15c7a7649a1202254b4.tar.xz
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
-rwxr-xr-xcontrib/remote-helpers/git-remote-hg6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 0194c67fb..85abbedb1 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -678,6 +678,11 @@ def get_merge_files(repo, p1, p2, files):
f = { 'ctx' : repo[p1][e] }
files[e] = f
+def c_style_unescape(string):
+ if string[0] == string[-1] == '"':
+ return string.decode('string-escape')[1:-1]
+ return string
+
def parse_commit(parser):
global marks, blob_marks, parsed_refs
global mode
@@ -720,6 +725,7 @@ def parse_commit(parser):
f = { 'deleted' : True }
else:
die('Unknown file command: %s' % line)
+ path = c_style_unescape(path).decode('utf-8')
files[path] = f
# only export the commits if we are on an internal proxy repo