diff mercurial/obsolete.py @ 32521:176d1a0ce385

obsolete: fix relevant-obsmarkers computation on pruned changeset The markers pruning a node was not directly considered relevant for the pruned node, only to its parents. This went unnoticed during obsmarkers exchange because all ancestors of the pruned node would be included in the computation. This still affects obsmarkers exchange a bit since "inline" prune markers would be ignored (see second test case). This went unnoticed, because in such case, we always push another obsolescence markers for that node. We add explicit tests covering this case. (The set of relevant changeset is use in the obsmarkers discovery protocol used in the evolve experimental extension, the impact will be handled on the extension side).
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 25 May 2017 19:37:29 +0200
parents 08d02c1d7e67
children 19df975eb555
line wrap: on
line diff
--- a/mercurial/obsolete.py	Thu May 25 19:37:07 2017 +0200
+++ b/mercurial/obsolete.py	Thu May 25 19:37:29 2017 +0200
@@ -720,6 +720,7 @@
         seenmarkers = set()
         seennodes = set(pendingnodes)
         precursorsmarkers = self.precursors
+        succsmarkers = self.successors
         children = self.children
         while pendingnodes:
             direct = set()
@@ -727,6 +728,8 @@
                 direct.update(precursorsmarkers.get(current, ()))
                 pruned = [m for m in children.get(current, ()) if not m[1]]
                 direct.update(pruned)
+                pruned = [m for m in succsmarkers.get(current, ()) if not m[1]]
+                direct.update(pruned)
             direct -= seenmarkers
             pendingnodes = set([m[0] for m in direct])
             seenmarkers |= direct