aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-11-01 07:38:35 -0700
committerJunio C Hamano <gitster@pobox.com>2013-11-01 07:38:35 -0700
commit583736c0bcf09adaa5621b142d8e43c22354041b (patch)
treefee7314d9b626e787c16e2588ea2ce7e3422fb85 /contrib
parent9dd860c8562917dbbdd595d5f9997b6856dbeb0a (diff)
parent113626537711e290af46548683e02ae0a2f51b6f (diff)
downloadgit-583736c0bcf09adaa5621b142d8e43c22354041b.tar.gz
git-583736c0bcf09adaa5621b142d8e43c22354041b.tar.xz
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
Diffstat (limited to 'contrib')
-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 92d994e47..3222afd9d 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -703,6 +703,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):
from_mark = merge_mark = None
@@ -742,6 +747,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