[PATCH 6 of 8 v4] convert: do not provide head revisions if we have no changests to import

David Soria Parra davidsp at fb.com
Wed Dec 14 04:46:42 EST 2016


# HG changeset patch
# User David Soria Parra <davidsp at fb.com>
# Date 1481694598 28800
#      Tue Dec 13 21:49:58 2016 -0800
# Node ID c6c26e238617600d0523b44a9043d17f963f9eda
# Parent  4b9d267d2a05970d9320b83f8bf29ec99f8ab40f
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.

diff --git a/hgext/convert/p4.py b/hgext/convert/p4.py
--- a/hgext/convert/p4.py
+++ b/hgext/convert/p4.py
@@ -228,7 +228,7 @@
             self.copies[change] = copies
             lastid = change
 
-        if lastid:
+        if lastid and len(self.changeset) > 0:
             self.heads = [lastid]
 
     def getheads(self):


More information about the Mercurial-devel mailing list