diff mercurial/phases.py @ 38682:88efb7d6bcb6

phases: remove excessive optimization from newheads() (issue5939) This function is intended to compute 'heads(::heads - roots::)', but it failed because 'heads + parents(roots)' missed sibling branches of the roots. That's why the public heads slipped down from D to B in the example added by 2a227782e754 "tests: add test demonstrating phase loss when cloning": > E draft > |\Z draft > | Y draft > D | public > | X draft > C/ public > B public > A public where heads = {E, Z}, roots = {X}
author Yuya Nishihara <yuya@tcha.org>
date Sat, 14 Jul 2018 13:19:18 +0900
parents 36ba5dba372d
children ddd2165438cd
line wrap: on
line diff
--- a/mercurial/phases.py	Sun Jul 15 15:48:18 2018 +0530
+++ b/mercurial/phases.py	Sat Jul 14 13:19:18 2018 +0900
@@ -665,8 +665,7 @@
     * `heads`: define the first subset
     * `roots`: define the second we subtract from the first"""
     repo = repo.unfiltered()
-    revset = repo.set('heads((%ln + parents(%ln)) - (%ln::%ln))',
-                      heads, roots, roots, heads)
+    revset = repo.set('heads(::%ln - (%ln::%ln))', heads, roots, heads)
     return [c.node() for c in revset]