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