revset.bisect: add new 'pruned' set to the bisect keyword
The 'pruned' set is made of changesets that did participate to
the bisection. They are made of
- all good changesets
- all bad changsets
- all skipped changesets, provided they are in the bisection range
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
--- a/mercurial/hbisect.py Sat Sep 17 17:33:34 2011 +0200
+++ b/mercurial/hbisect.py Sat Sep 17 17:30:35 2011 +0200
@@ -160,6 +160,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
"""
state = load_state(repo)
if status in ('good', 'bad', 'skip'):
@@ -190,6 +191,9 @@
if status == 'range':
return [c for c in range]
+ 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)]
else:
raise error.ParseError(_('invalid bisect state'))
--- a/mercurial/revset.py Sat Sep 17 17:33:34 2011 +0200
+++ b/mercurial/revset.py Sat Sep 17 17:30:35 2011 +0200
@@ -241,6 +241,7 @@
``skip``), or any of the meta-status:
- ``range`` : all csets taking part in the bisection
+ - ``pruned`` : good|bad|skip, excluding out-of-range csets
"""
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:33:34 2011 +0200
+++ b/tests/test-bisect2.t Sat Sep 17 17:30:35 2011 +0200
@@ -288,6 +288,14 @@
15:857b178a7cf3
16:609d82a7ebae
17:228c06deef46
+ $ hg log -q -r 'bisect(pruned)'
+ 0:33b1f9bc8bc5
+ 6:a214d5d3811a
+ 8:dab8161ac8fc
+ 9:3c77083deb4a
+ 10:429fcd26f52d
+ 13:b0a32c86eb31
+ 17:228c06deef46
complex bisect test 2 # first good rev is 13
@@ -327,6 +335,13 @@
13:b0a32c86eb31
15:857b178a7cf3
18:d42e18c7bc9b
+ $ hg log -q -r 'bisect(pruned)'
+ 1:4ca5088da217
+ 6:a214d5d3811a
+ 10:429fcd26f52d
+ 12:9f259202bbe7
+ 13:b0a32c86eb31
+ 18:d42e18c7bc9b
complex bisect test 3
@@ -394,6 +409,15 @@
13:b0a32c86eb31
15:857b178a7cf3
16:609d82a7ebae
+ $ hg log -q -r 'bisect(pruned)'
+ 1:4ca5088da217
+ 6:a214d5d3811a
+ 9:3c77083deb4a
+ 10:429fcd26f52d
+ 12:9f259202bbe7
+ 13:b0a32c86eb31
+ 15:857b178a7cf3
+ 16:609d82a7ebae
complex bisect test 4
@@ -443,6 +467,13 @@
15:857b178a7cf3
16:609d82a7ebae
17:228c06deef46
+ $ hg log -q -r 'bisect(pruned)'
+ 8:dab8161ac8fc
+ 10:429fcd26f52d
+ 13:b0a32c86eb31
+ 15:857b178a7cf3
+ 16:609d82a7ebae
+ 17:228c06deef46
test unrelated revs:
@@ -452,6 +483,7 @@
abort: starting revisions are not directly related
[255]
$ hg log -q -r 'bisect(range)'
+ $ hg log -q -r 'bisect(pruned)'
$ hg bisect --reset
end at merge: 17 bad, 11 good (but 9 is first bad)
@@ -483,6 +515,11 @@
15:857b178a7cf3
16:609d82a7ebae
17:228c06deef46
+ $ hg log -q -r 'bisect(pruned)'
+ 11:82ca6f06eccd
+ 13:b0a32c86eb31
+ 15:857b178a7cf3
+ 17:228c06deef46
$ hg bisect --extend
Extending search to changeset 8:dab8161ac8fc
2 files updated, 0 files merged, 2 files removed, 0 files unresolved
@@ -506,6 +543,13 @@
15:857b178a7cf3
16:609d82a7ebae
17:228c06deef46
+ $ hg log -q -r 'bisect(pruned)'
+ 8:dab8161ac8fc
+ 9:3c77083deb4a
+ 11:82ca6f06eccd
+ 13:b0a32c86eb31
+ 15:857b178a7cf3
+ 17:228c06deef46
user adds irrelevant but consistent information (here: -g 2) to bisect state
@@ -530,3 +574,7 @@
11:82ca6f06eccd
12:9f259202bbe7
13:b0a32c86eb31
+ $ hg log -q -r 'bisect(pruned)'
+ 8:dab8161ac8fc
+ 11:82ca6f06eccd
+ 13:b0a32c86eb31