Skip to content

Commit

Permalink
hg-to-git: fix parent analysis
Browse files Browse the repository at this point in the history
Fix a bug in the hg-to-git convertor introduced by commit
1bc7c13: 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>
  • Loading branch information
Stelian Pop authored and Junio C Hamano committed Feb 16, 2008
1 parent 87f1b88 commit 13bf1a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/hg-to-git/hg-to-git.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def getgitenv(user, date):
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()
Expand Down

0 comments on commit 13bf1a9

Please sign in to comment.