convert: return commit objects for revisions in the revmap
Source revision data that exists in the revmap are ignored when pulling
data from Perforce as we consider them already imported. In case where
the `convertcmd.convert` algorithm requests a commit object for such
a revision we are creating it. This is usually the case for parent of
the first imported revision.
--- a/hgext/convert/p4.py Tue Dec 13 21:49:58 2016 -0800
+++ b/hgext/convert/p4.py Wed Dec 14 12:07:23 2016 -0800
@@ -321,7 +321,13 @@
return marshal.load(stdout)
def getcommit(self, rev):
- return self.changeset[rev]
+ if rev in self.changeset:
+ return self.changeset[rev]
+ elif rev in self.revmap:
+ d = self._fetch_revision(rev)
+ return self._construct_commit(d, parents=None)
+ raise error.Abort(
+ _("cannot find %s in the revmap or parsed changesets") % rev)
def gettags(self):
return {}