diff mercurial/hbisect.py @ 15147:395ca8cd2669

revset.bisect: add 'ignored' set to the bisect keyword The 'ignored' changesets are outside the bisection range, but are changesets that may have an impact on the outcome of the bisection. For example, in case there's a merge between the good and bad csets, but the branch-point is out of the bisection range, and the issue originates from this branch, the branch will not be visited by bisect and bisect will find that the culprit cset is the merge. So, the 'ignored' set is equivalent to: ( ( ::bisect(bad) - ::bisect(good) ) | ( ::bisect(good) - ::bisect(bad) ) ) - bisect(range) - all ancestors of bad csets that are not ancestors of good csets, or - all ancestors of good csets that are not ancestors of bad csets - but that are not in the bisection range. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
date Tue, 20 Sep 2011 20:21:04 +0200
parents b39d85be78a8
children fa0a464e4ca5
line wrap: on
line diff
--- a/mercurial/hbisect.py	Tue Sep 20 20:19:48 2011 +0200
+++ b/mercurial/hbisect.py	Tue Sep 20 20:21:04 2011 +0200
@@ -162,6 +162,7 @@
     - ``range``              : all csets taking part in the bisection
     - ``pruned``             : csets that are good, bad or skipped
     - ``untested``           : csets whose fate is yet unknown
+    - ``ignored``            : csets ignored due to DAG topology
     """
     state = load_state(repo)
     if status in ('good', 'bad', 'skip'):
@@ -191,12 +192,22 @@
         # 'untested' is all cset that are- in 'range', but not in 'pruned'
         untested = '( (%s) - (%s) )' % (range, pruned)
 
+        # 'ignored' is all csets that were not used during the bisection
+        # due to DAG topology, but may however have had an impact.
+        # Eg., a branch merged between bads and goods, but whose branch-
+        # point is out-side of the range.
+        iba = '::bisect(bad) - ::bisect(good)'  # Ignored bads' ancestors
+        iga = '::bisect(good) - ::bisect(bad)'  # Ignored goods' ancestors
+        ignored = '( ( (%s) | (%s) ) - (%s) )' % (iba, iga, range)
+
         if status == 'range':
             return [c.rev() for c in repo.set(range)]
         elif status == 'pruned':
             return [c.rev() for c in repo.set(pruned)]
         elif status == 'untested':
             return [c.rev() for c in repo.set(untested)]
+        elif status == 'ignored':
+            return [c.rev() for c in repo.set(ignored)]
 
         else:
             raise error.ParseError(_('invalid bisect state'))