createmarkers: automatically record the parent of pruned changesets
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 18 Aug 2014 16:17:16 -0700
changeset 22256 3ae6cc6173e3
parent 22255 adb3798dce49
child 22257 4bc96685a40c
createmarkers: automatically record the parent of pruned changesets We need this information to build the set of relevant markers during exchanges. This can only be done at the `createmarkers` level since the `obsstore.create` function does not have a repo and therefore has no access to the parent information.
mercurial/obsolete.py
--- a/mercurial/obsolete.py	Mon Aug 18 16:12:29 2014 -0700
+++ b/mercurial/obsolete.py	Mon Aug 18 16:17:16 2014 -0700
@@ -886,10 +886,13 @@
                                  % prec)
             nprec = prec.node()
             nsucs = tuple(s.node() for s in sucs)
+            npare = None
+            if not nsucs:
+                npare = tuple(p.node() for p in prec.parents())
             if nprec in nsucs:
                 raise util.Abort("changeset %s cannot obsolete itself" % prec)
-            repo.obsstore.create(tr, nprec, nsucs, flag, date=date,
-                                 metadata=localmetadata)
+            repo.obsstore.create(tr, nprec, nsucs, flag, parents=npare,
+                                 date=date, metadata=localmetadata)
             repo.filteredrevcache.clear()
         tr.close()
     finally: