зеркало из https://github.com/microsoft/git.git
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
This commit is contained in:
Коммит
583736c0bc
|
@ -703,6 +703,11 @@ def get_merge_files(repo, p1, p2, files):
|
||||||
f = { 'ctx' : repo[p1][e] }
|
f = { 'ctx' : repo[p1][e] }
|
||||||
files[e] = f
|
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):
|
def parse_commit(parser):
|
||||||
from_mark = merge_mark = None
|
from_mark = merge_mark = None
|
||||||
|
|
||||||
|
@ -742,6 +747,7 @@ def parse_commit(parser):
|
||||||
f = { 'deleted' : True }
|
f = { 'deleted' : True }
|
||||||
else:
|
else:
|
||||||
die('Unknown file command: %s' % line)
|
die('Unknown file command: %s' % line)
|
||||||
|
path = c_style_unescape(path).decode('utf-8')
|
||||||
files[path] = f
|
files[path] = f
|
||||||
|
|
||||||
# only export the commits if we are on an internal proxy repo
|
# only export the commits if we are on an internal proxy repo
|
||||||
|
|
Загрузка…
Ссылка в новой задаче