summaryrefslogtreecommitdiff
path: root/contrib/hg-to-git/hg-to-git.py
diff options
context:
space:
mode:
authorStelian Pop <stelian@popies.net>2008-02-15 21:20:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-16 07:01:49 (GMT)
commit13bf1a99764ea751f6fa75502309d8b91529623a (patch)
tree8e270b04467ece55d4421e006cf4dba028294759 /contrib/hg-to-git/hg-to-git.py
parent87f1b8849bf0094e0b20cd294e1f2b04976ddf41 (diff)
downloadgit-13bf1a99764ea751f6fa75502309d8b91529623a.zip
git-13bf1a99764ea751f6fa75502309d8b91529623a.tar.gz
git-13bf1a99764ea751f6fa75502309d8b91529623a.tar.bz2
hg-to-git: fix parent analysis
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>
Diffstat (limited to 'contrib/hg-to-git/hg-to-git.py')
-rwxr-xr-xcontrib/hg-to-git/hg-to-git.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py
index c35b158..d72ffbb 100755
--- a/contrib/hg-to-git/hg-to-git.py
+++ b/contrib/hg-to-git/hg-to-git.py
@@ -111,7 +111,7 @@ hgparents["0"] = (None, None)
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()