revset.bisect: add new 'untested' set to the bisect keyword
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat, 17 Sep 2011 14:33:20 +0200
changeset 15138 883d28233a4d
parent 15137 91f93dcd72aa
child 15139 0834e0bb445a
revset.bisect: add new 'untested' set to the bisect keyword The 'untested' set is made of changesets that are in the bisection range but for which the status is still unknown, and that can later be used to further decide on the bisection outcome. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
mercurial/hbisect.py
mercurial/revset.py
tests/test-bisect2.t
--- a/mercurial/hbisect.py	Sat Sep 17 17:30:35 2011 +0200
+++ b/mercurial/hbisect.py	Sat Sep 17 14:33:20 2011 +0200
@@ -161,6 +161,7 @@
     - ``good``, ``bad``, ``skip``: as the names imply
     - ``range``              : all csets taking part in the bisection
     - ``pruned``             : good|bad|skip, excluding out-of-range csets
+    - ``untested``           : csets whose fate is yet unknown
     """
     state = load_state(repo)
     if status in ('good', 'bad', 'skip'):
@@ -194,6 +195,9 @@
         elif status == 'pruned':
             # We do not want skipped csets that are out-of-range
             return [c for c in range if c in (goods | bads | skips)]
+        elif status == 'untested':
+            # Return the csets in range that are not pruned
+            return [c for c in range if not c in (goods | bads | skips)]
 
         else:
             raise error.ParseError(_('invalid bisect state'))
--- a/mercurial/revset.py	Sat Sep 17 17:30:35 2011 +0200
+++ b/mercurial/revset.py	Sat Sep 17 14:33:20 2011 +0200
@@ -242,6 +242,7 @@
 
     - ``range``      : all csets taking part in the bisection
     - ``pruned``     : good|bad|skip, excluding out-of-range csets
+    - ``untested``   : csets whose fate is yet unknown
     """
     status = getstring(x, _("bisect requires a string")).lower()
     return [r for r in subset if r in hbisect.get(repo, status)]
--- a/tests/test-bisect2.t	Sat Sep 17 17:30:35 2011 +0200
+++ b/tests/test-bisect2.t	Sat Sep 17 14:33:20 2011 +0200
@@ -252,6 +252,21 @@
   $ hg bisect -b 17   # -> update to rev 6
   Testing changeset 6:a214d5d3811a (15 changesets remaining, ~3 tests)
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg log -q -r 'bisect(untested)'
+  1:4ca5088da217
+  2:051e12f87bf1
+  3:0950834f0a9c
+  4:5c668c22234f
+  5:385a529b6670
+  6:a214d5d3811a
+  8:dab8161ac8fc
+  9:3c77083deb4a
+  10:429fcd26f52d
+  11:82ca6f06eccd
+  12:9f259202bbe7
+  13:b0a32c86eb31
+  15:857b178a7cf3
+  16:609d82a7ebae
   $ hg bisect -g      # -> update to rev 13
   Testing changeset 13:b0a32c86eb31 (9 changesets remaining, ~3 tests)
   3 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -296,6 +311,16 @@
   10:429fcd26f52d
   13:b0a32c86eb31
   17:228c06deef46
+  $ hg log -q -r 'bisect(untested)'
+  1:4ca5088da217
+  2:051e12f87bf1
+  3:0950834f0a9c
+  4:5c668c22234f
+  5:385a529b6670
+  11:82ca6f06eccd
+  12:9f259202bbe7
+  15:857b178a7cf3
+  16:609d82a7ebae
 
 complex bisect test 2  # first good rev is 13
 
@@ -310,6 +335,17 @@
   $ hg bisect -b      # -> update to rev 12
   Testing changeset 12:9f259202bbe7 (5 changesets remaining, ~2 tests)
   3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg log -q -r 'bisect(untested)'
+  2:051e12f87bf1
+  3:0950834f0a9c
+  4:5c668c22234f
+  5:385a529b6670
+  8:dab8161ac8fc
+  9:3c77083deb4a
+  11:82ca6f06eccd
+  12:9f259202bbe7
+  13:b0a32c86eb31
+  15:857b178a7cf3
   $ hg bisect -b      # -> update to rev 13
   Testing changeset 13:b0a32c86eb31 (3 changesets remaining, ~1 tests)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -520,9 +556,15 @@
   13:b0a32c86eb31
   15:857b178a7cf3
   17:228c06deef46
+  $ hg log -q -r 'bisect(untested)'
+  12:9f259202bbe7
+  16:609d82a7ebae
   $ hg bisect --extend
   Extending search to changeset 8:dab8161ac8fc
   2 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg log -q -r 'bisect(untested)'
+  12:9f259202bbe7
+  16:609d82a7ebae
   $ hg bisect -g # dab8161ac8fc
   Testing changeset 9:3c77083deb4a (3 changesets remaining, ~1 tests)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -550,6 +592,10 @@
   13:b0a32c86eb31
   15:857b178a7cf3
   17:228c06deef46
+  $ hg log -q -r 'bisect(untested)'
+  10:429fcd26f52d
+  12:9f259202bbe7
+  16:609d82a7ebae
 
 user adds irrelevant but consistent information (here: -g 2) to bisect state
 
@@ -558,9 +604,15 @@
   $ hg bisect -g 8
   Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests)
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log -q -r 'bisect(untested)'
+  11:82ca6f06eccd
+  12:9f259202bbe7
   $ hg bisect -g 2
   Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log -q -r 'bisect(untested)'
+  11:82ca6f06eccd
+  12:9f259202bbe7
   $ hg bisect -b
   The first bad revision is:
   changeset:   11:82ca6f06eccd
@@ -578,3 +630,5 @@
   8:dab8161ac8fc
   11:82ca6f06eccd
   13:b0a32c86eb31
+  $ hg log -q -r 'bisect(untested)'
+  12:9f259202bbe7