# HG changeset patch # User pacien # Date 1682080378 -7200 # Node ID 1a4f54574e3d63fdd5d6ad6285245e6b281d76b5 # Parent 58adcabc295fe966e636960e86b41524e368e67b stabletailgraph: clarify naiveness of current implementation Both the naive and the actual versions of the algorithms are going to co-exist for the tests. This makes is clearer that this one is naive. diff -r 58adcabc295f -r 1a4f54574e3d mercurial/debugcommands.py --- a/mercurial/debugcommands.py Fri May 19 14:49:50 2023 +0200 +++ b/mercurial/debugcommands.py Fri Apr 21 14:32:58 2023 +0200 @@ -3671,7 +3671,7 @@ cl = repo.changelog displayer = logcmdutil.maketemplater(ui, repo, template) - sorted_revs = stabletailsort._stable_tail_sort(cl, rev) + sorted_revs = stabletailsort._stable_tail_sort_naive(cl, rev) for ancestor_rev in sorted_revs: displayer.show(repo[ancestor_rev]) diff -r 58adcabc295f -r 1a4f54574e3d mercurial/stabletailgraph/stabletailsort.py --- a/mercurial/stabletailgraph/stabletailsort.py Fri May 19 14:49:50 2023 +0200 +++ b/mercurial/stabletailgraph/stabletailsort.py Fri Apr 21 14:32:58 2023 +0200 @@ -74,7 +74,7 @@ return p1, p2 -def _stable_tail_sort(cl, head_rev): +def _stable_tail_sort_naive(cl, head_rev): """ Naive topological iterator of the ancestors given by the stable-tail sort. @@ -103,7 +103,9 @@ cl.parentrevs, (pt,), inclusive=True ) exclusive_ancestors = ( - a for a in _stable_tail_sort(cl, px) if a not in tail_ancestors + a + for a in _stable_tail_sort_naive(cl, px) + if a not in tail_ancestors ) excl_part_size = cl.fast_rank(cursor_rev) - cl.fast_rank(pt) - 1