comparison mercurial/obsolete.py @ 32488: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
comparison
equal deleted inserted replaced
32487:f475446b4837 32488:176d1a0ce385
718 718
719 pendingnodes = set(nodes) 719 pendingnodes = set(nodes)
720 seenmarkers = set() 720 seenmarkers = set()
721 seennodes = set(pendingnodes) 721 seennodes = set(pendingnodes)
722 precursorsmarkers = self.precursors 722 precursorsmarkers = self.precursors
723 succsmarkers = self.successors
723 children = self.children 724 children = self.children
724 while pendingnodes: 725 while pendingnodes:
725 direct = set() 726 direct = set()
726 for current in pendingnodes: 727 for current in pendingnodes:
727 direct.update(precursorsmarkers.get(current, ())) 728 direct.update(precursorsmarkers.get(current, ()))
728 pruned = [m for m in children.get(current, ()) if not m[1]] 729 pruned = [m for m in children.get(current, ()) if not m[1]]
730 direct.update(pruned)
731 pruned = [m for m in succsmarkers.get(current, ()) if not m[1]]
729 direct.update(pruned) 732 direct.update(pruned)
730 direct -= seenmarkers 733 direct -= seenmarkers
731 pendingnodes = set([m[0] for m in direct]) 734 pendingnodes = set([m[0] for m in direct])
732 seenmarkers |= direct 735 seenmarkers |= direct
733 pendingnodes -= seennodes 736 pendingnodes -= seennodes