I'm trying to convert several Perforce workspaces to Mercurial. Some have been OK, but some are failing with the following: H:\src\hg>hg convert -s p4 //myRepo/... myRepo initializing destination myRepo repository reading p4 views collecting p4 changelists ** unknown exception encountered, please report by visiting ** http://mercurial.selenic.com/wiki/BugTracker ** Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] ** Mercurial Distributed SCM (version 3.0.1) ** Extensions loaded: convert Traceback (most recent call last): File "hg", line 38, in <module> File "mercurial\dispatch.pyc", line 28, in run File "mercurial\dispatch.pyc", line 69, in dispatch File "mercurial\dispatch.pyc", line 138, in _runcatch File "mercurial\dispatch.pyc", line 819, in _dispatch File "mercurial\dispatch.pyc", line 599, in runcommand File "mercurial\dispatch.pyc", line 910, in _runcommand File "mercurial\dispatch.pyc", line 881, in checkargs File "mercurial\dispatch.pyc", line 816, in <lambda> File "mercurial\util.pyc", line 518, in check File "hgext\convert\__init__.pyc", line 283, in convert File "hgext\convert\convcmd.pyc", line 502, in convert File "hgext\convert\convcmd.pyc", line 56, in convertsource File "hgext\convert\p4.pyc", line 52, in __init__ File "hgext\convert\p4.pyc", line 111, in _parse KeyError: 'desc'
You have a commit with no description. I recommend this patch flogging the appropriate committer. diff -r c00822e0b8ea hgext/convert/p4.py --- a/hgext/convert/p4.py Sat Jun 14 11:56:20 2014 -0500 +++ b/hgext/convert/p4.py Mon Jun 16 11:59:12 2014 -0500 @@ -108,7 +108,7 @@ cmd = "p4 -G describe -s %s" % change stdout = util.popen(cmd, mode='rb') d = marshal.load(stdout) - desc = self.recode(d["desc"]) + desc = self.recode(d.get("desc", "")) shortdesc = desc.split("\n", 1)[0] t = '%s %s' % (d["change"], repr(shortdesc)[1:-1]) ui.status(util.ellipsis(t, 80) + '\n')
(In reply to comment #1) Thanks Matt. It turns out the problem is due to a corrupt P4 database: > p4 -G describe -s 1 {scodeserrorsdatasIOperation 'user-describe' failed. Revision table out of sync with index!
Fixed by http://selenic.com/repo/hg/rev/c27a37678508 Matt Mackall <mpm@selenic.com> p4: accept changesets with no description (issue4282) (please test the fix)