Merge branch 'jk/robustify-parse-commit'
[gitweb.git] / contrib / remote-helpers / git-remote-hg
index 92d994e470f05db8536ba443a6afb192be8c2452..c6026b9bed37a91e30a278a02013072d21507061 100755 (executable)
@@ -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)
         files[path] = f
 
     # only export the commits if we are on an internal proxy repo