David Soria Parra <davidsp@fb.com> [Wed, 14 Dec 2016 12:07:23 -0800] rev 30604
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.
David Soria Parra <davidsp@fb.com> [Tue, 13 Dec 2016 21:49:58 -0800] rev 30603
convert: encapsulate commit data fetching and commit object creation
Split fetching the `describe` form from Perforce and the commit object creation
into two functions. This allows us to reuse the commit construction for
revisions passed from a revmap.
David Soria Parra <davidsp@fb.com> [Tue, 13 Dec 2016 21:49:58 -0800] rev 30602
convert: do not provide head revisions if we have no changests to import
Don't set a head revision in cases where we have a revmap but no
changesets to import, as convertcmd.convert() treats them as heads of
to-imported revisions.
David Soria Parra <davidsp@fb.com> [Wed, 14 Dec 2016 01:45:57 -0800] rev 30601
convert: allow passing in a revmap
Implement `common.setrevmap` which is used to pass in a file with existing
revision mappings. This functionality is used by `convertcmd.convert` if it
exists and allows implementors such as the p4 converter to make use of an
existing mapping.
We are using the revmap to abort scanning and the repository for more information
if we already have the revision. This means we are allowing incremental imports
in cases where a revmap is provided.
David Soria Parra <davidsp@fb.com> [Tue, 13 Dec 2016 21:49:58 -0800] rev 30600
convert: use convert_revision for P4 imports
We are using convert_revisions in other importers. In order to unify this
we are also using convert_revision for Perforce in addition to the original
'p4'.
David Soria Parra <davidsp@fb.com> [Wed, 14 Dec 2016 01:45:17 -0800] rev 30599
convert: remove unused dictionaries
self.parent, self.lastbranch and self.tags have never been used.
David Soria Parra <davidsp@fb.com> [Wed, 14 Dec 2016 01:43:47 -0800] rev 30598
convert: self.heads is a list
self.heads is used as a list throughout convert and never a dictionary.
Initialize it correctly to a list.
David Soria Parra <davidsp@fb.com> [Tue, 13 Dec 2016 21:49:58 -0800] rev 30597
convert: don't use long list comprehensions
We are iterating over p4changes. Make the continue condition more clear
and easier to add new conditions in future patches, by removing the list
comprehension and move the condition into the existing for-loop.