tests/test-revlog-ancestry.py.out
author Boris Feld <boris.feld@octobus.net>
Thu, 06 Sep 2018 17:00:28 -0400
changeset 39473 b6db2e80a9ce
parent 18081 f88c60e740a1
child 39474 a60dae060bc8
permissions -rw-r--r--
ancestors: actually iterate over ancestors in topological order (issue5979) This code previously used a dequeue logic, the first ancestors seen were the first ancestors to be emitted. In branching/merging situations, it can result in ancestors being yielded before their descendants, breaking the object contract. We got affected by this issue while working on the copy tracing code. At about the same time, Axel Hecht <axel@mozilla.com> reported the issue and provided the test case used in this changeset. Thanks Axel. Running `hg perfancestors` does not show a significant difference between the old and the new version.

Ancestors of 5
4 2 0 
Ancestors of 6 and 5
4 3 2 1 0 
Ancestors of 5 and 4
4 2 0 
Ancestors of 7, stop at 6
6 
Ancestors of 7, including revs
7 6 5 4 3 2 1 0 
Ancestors of 7, 5 and 3, including revs
7 5 3 6 4 2 1 0 

Descendants of 5
7 8 
Descendants of 5 and 3
6 7 8 
Descendants of 5 and 4
5 7 8