@matheusbsbs / matheus-bagliano / commits / 13bf1a9976
Fork 0

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>

Stelian Pop committed Feb 15, 2008 at 22:20 UTC 13bf1a99764ea751f6fa75502309d8b91529623a
1 file changed +1 -1
contrib/hg-to-git/hg-to-git.py
+1 -1
@@ -111,7 +111,7 @@ hgparents["0"] = (None, None)
111 hgbranch["0"] = "master"
112 for cset in range(1, int(tip) + 1):
113 hgchildren[str(cset)] = ()
114 - prnts = os.popen('hg log -r %d --template "{parents}"' % cset).read().split(' ')
114 + prnts = os.popen('hg log -r %d --template "{parents}"' % cset).read().strip().split(' ')
115 prnts = map(lambda x: x[:x.find(':')], prnts)
116 if prnts[0] != '':
117 parent = prnts[0].strip()