1
0
mirror of https://github.com/git/git.git synced 2024-10-22 13:39:05 +02:00

remote-hg: fix for files with spaces

Set the maximum number of splits to make when dividing the diff stat
lines based on space characters.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Peter van Zetten 2013-04-11 07:23:00 -05:00 committed by Junio C Hamano
parent 031873f8f1
commit 15a8d901dd

@ -578,7 +578,7 @@ def parse_commit(parser):
mark = int(mark_ref[1:]) mark = int(mark_ref[1:])
f = { 'mode' : hgmode(m), 'data' : blob_marks[mark] } f = { 'mode' : hgmode(m), 'data' : blob_marks[mark] }
elif parser.check('D'): elif parser.check('D'):
t, path = line.split(' ') t, path = line.split(' ', 1)
f = { 'deleted' : True } f = { 'deleted' : True }
else: else:
die('Unknown file command: %s' % line) die('Unknown file command: %s' % line)
@ -625,7 +625,7 @@ def parse_commit(parser):
i = data.find('\n--HG--\n') i = data.find('\n--HG--\n')
if i >= 0: if i >= 0:
tmp = data[i + len('\n--HG--\n'):].strip() tmp = data[i + len('\n--HG--\n'):].strip()
for k, v in [e.split(' : ') for e in tmp.split('\n')]: for k, v in [e.split(' : ', 1) for e in tmp.split('\n')]:
if k == 'rename': if k == 'rename':
old, new = v.split(' => ', 1) old, new = v.split(' => ', 1)
files[new]['rename'] = old files[new]['rename'] = old