Skip to content

Commit

Permalink
Merge branch 'ap/remote-hg-unquote-cquote'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Nov 1, 2013
2 parents 9dd860c + 1136265 commit 583736c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contrib/remote-helpers/git-remote-hg
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 583736c

Please sign in to comment.