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>
Peter van Zetten committed
Apr 11, 2013 at 07:23 UTC
15a8d901dd38cdc10d6b17d718e20e8ba91c66d1
1 file changed
+2
-2
contrib/remote-helpers/git-remote-hg
+2
-2
@@ -578,7 +578,7 @@ def parse_commit(parser):
578
mark = int(mark_ref[1:])
579
f = { 'mode' : hgmode(m), 'data' : blob_marks[mark] }
580
elif parser.check('D'):
581
- t, path = line.split(' ')
581
+ t, path = line.split(' ', 1)
582
f = { 'deleted' : True }
583
else:
584
die('Unknown file command: %s' % line)
@@ -625,7 +625,7 @@ def parse_commit(parser):
625
i = data.find('\n--HG--\n')
626
if i >= 0:
627
tmp = data[i + len('\n--HG--\n'):].strip()
628
- for k, v in [e.split(' : ') for e in tmp.split('\n')]:
628
+ for k, v in [e.split(' : ', 1) for e in tmp.split('\n')]:
629
if k == 'rename':
630
old, new = v.split(' => ', 1)
631
files[new]['rename'] = old