Patchwork [6,of,6,convert] Create commits from revmap list if needed

login
register
mail settings
Submitter David Soria Parra
Date Dec. 7, 2016, 8:52 p.m.
Message ID <8dfeb4ee8c626d50f040.1481143955@devbig415.prn1.facebook.com>
Download mbox | patch
Permalink /patch/17850/
State Superseded
Headers show

Comments

David Soria Parra - Dec. 7, 2016, 8:52 p.m.
# HG changeset patch
# User David Soria Parra <davidsp@fb.com>
# Date 1481143876 28800
#      Wed Dec 07 12:51:16 2016 -0800
# Node ID 8dfeb4ee8c626d50f0402a9bd1939ee916bf9b42
# Parent  e6aa56ec31278dcb4984f65776a3715a92aba180
[convert] Create commits from revmap list if needed

Patch

diff --git a/hgext/convert/p4.py b/hgext/convert/p4.py
--- a/hgext/convert/p4.py
+++ b/hgext/convert/p4.py
@@ -314,6 +314,12 @@ 
         return marshal.load(stdout)
 
     def getcommit(self, rev):
+        if rev not in self.changeset and rev not in self.revmap:
+            raise error.Abort(
+                _("cannot find %s in the revmap or parsed changesets") % rev)
+        if rev not in self.changeset:
+            d = self._fetch_revision(rev)
+            return self._construct_commit(d, parents=None)
         return self.changeset[rev]
 
     def gettags(self):