Patchwork [6,of,8,v5] convert: do not provide head revisions if we have no changests to import

login
register
mail settings
Submitter David Soria Parra
Date Dec. 14, 2016, 8:09 p.m.
Message ID <c6c26e238617600d0523.1481746167@devbig415.prn1.facebook.com>
Download mbox | patch
Permalink /patch/17918/
State Accepted
Headers show

Comments

David Soria Parra - Dec. 14, 2016, 8:09 p.m.
# HG changeset patch
# User David Soria Parra <davidsp@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.

Patch

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):