summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 87f1b88)
raw | patch | inline | side by side (parent: 87f1b88)
author | Stelian Pop <stelian@popies.net> | |
Fri, 15 Feb 2008 21:20:44 +0000 (22:20 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 16 Feb 2008 07:01:49 +0000 (23:01 -0800) |
Fix a bug in the hg-to-git convertor introduced by commit
1bc7c13af9f936aa80893100120b542338a10bf4: when searching the changeset
parents, 'hg log' returns an extra space at the end of the line, which
confuses the .split(' ') based tokenizer:
Traceback (most recent call last):
File "hg-to-git.py", line 123, in <module>
hgchildren[mparent] += ( str(cset), )
KeyError: ''
Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1bc7c13af9f936aa80893100120b542338a10bf4: when searching the changeset
parents, 'hg log' returns an extra space at the end of the line, which
confuses the .split(' ') based tokenizer:
Traceback (most recent call last):
File "hg-to-git.py", line 123, in <module>
hgchildren[mparent] += ( str(cset), )
KeyError: ''
Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/hg-to-git/hg-to-git.py | patch | blob | history |
index c35b15860d3a4edcf2cd93d082308ec7ce80e5f5..d72ffbb7773268514d8de29c5d5c33fdaf31f339 100755 (executable)
hgbranch["0"] = "master"
for cset in range(1, int(tip) + 1):
hgchildren[str(cset)] = ()
- prnts = os.popen('hg log -r %d --template "{parents}"' % cset).read().split(' ')
+ prnts = os.popen('hg log -r %d --template "{parents}"' % cset).read().strip().split(' ')
prnts = map(lambda x: x[:x.find(':')], prnts)
if prnts[0] != '':
parent = prnts[0].strip()