Mercurial > hg
annotate mercurial/hbisect.py @ 46150:a132aa5979ec
copies: no longer cache the ChangedFiles during copy tracing
Now that the copies information for both parents are processed all at once, we
no longer needs to cache this information, so we simplify the code.
The simpler code is also a (tiny) bit faster overall.
Repo Case Source-Rev Dest-Rev # of revisions old time new time Difference Factor time per rev
---------------------------------------------------------------------------------------------------------------------------------------------------------------
mercurial x_revs_x_added_0_copies ad6b123de1c7 39cfcef4f463 : 1 revs, 0.000041 s, 0.000041 s, +0.000000 s, × 1.0000, 41 µs/rev
mercurial x_revs_x_added_x_copies 2b1c78674230 0c1d10351869 : 6 revs, 0.000102 s, 0.000096 s, -0.000006 s, × 0.9412, 16 µs/rev
mercurial x000_revs_x000_added_x_copies 81f8ff2a9bf2 dd3267698d84 : 1032 revs, 0.004254 s, 0.004039 s, -0.000215 s, × 0.9495, 3 µs/rev
pypy x_revs_x_added_0_copies aed021ee8ae8 099ed31b181b : 9 revs, 0.000282 s, 0.000189 s, -0.000093 s, × 0.6702, 21 µs/rev
pypy x_revs_x000_added_0_copies 4aa4e1f8e19a 359343b9ac0e : 1 revs, 0.000048 s, 0.000047 s, -0.000001 s, × 0.9792, 47 µs/rev
pypy x_revs_x_added_x_copies ac52eb7bbbb0 72e022663155 : 7 revs, 0.000211 s, 0.000103 s, -0.000108 s, × 0.4882, 14 µs/rev
pypy x_revs_x00_added_x_copies c3b14617fbd7 ace7255d9a26 : 1 revs, 0.000375 s, 0.000286 s, -0.000089 s, × 0.7627, 286 µs/rev
pypy x_revs_x000_added_x000_copies df6f7a526b60 a83dc6a2d56f : 6 revs, 0.010574 s, 0.010436 s, -0.000138 s, × 0.9869, 1739 µs/rev
pypy x000_revs_xx00_added_0_copies 89a76aede314 2f22446ff07e : 4785 revs, 0.049974 s, 0.047465 s, -0.002509 s, × 0.9498, 9 µs/rev
pypy x000_revs_x000_added_x_copies 8a3b5bfd266e 2c68e87c3efe : 6780 revs, 0.084300 s, 0.082351 s, -0.001949 s, × 0.9769, 12 µs/rev
pypy x000_revs_x000_added_x000_copies 89a76aede314 7b3dda341c84 : 5441 revs, 0.060128 s, 0.058757 s, -0.001371 s, × 0.9772, 10 µs/rev
pypy x0000_revs_x_added_0_copies d1defd0dc478 c9cb1334cc78 : 43645 revs, 0.686542 s, 0.674129 s, -0.012413 s, × 0.9819, 15 µs/rev
pypy x0000_revs_xx000_added_0_copies bf2c629d0071 4ffed77c095c : 2 revs, 0.009277 s, 0.009434 s, +0.000157 s, × 1.0169, 4717 µs/rev
pypy x0000_revs_xx000_added_x000_copies 08ea3258278e d9fa043f30c0 : 11316 revs, 0.114733 s, 0.111935 s, -0.002798 s, × 0.9756, 9 µs/rev
netbeans x_revs_x_added_0_copies fb0955ffcbcd a01e9239f9e7 : 2 revs, 0.000081 s, 0.000078 s, -0.000003 s, × 0.9630, 39 µs/rev
netbeans x_revs_x000_added_0_copies 6f360122949f 20eb231cc7d0 : 2 revs, 0.000107 s, 0.000106 s, -0.000001 s, × 0.9907, 53 µs/rev
netbeans x_revs_x_added_x_copies 1ada3faf6fb6 5a39d12eecf4 : 3 revs, 0.000173 s, 0.000162 s, -0.000011 s, × 0.9364, 54 µs/rev
netbeans x_revs_x00_added_x_copies 35be93ba1e2c 9eec5e90c05f : 9 revs, 0.000698 s, 0.000695 s, -0.000003 s, × 0.9957, 77 µs/rev
netbeans x000_revs_xx00_added_0_copies eac3045b4fdd 51d4ae7f1290 : 1421 revs, 0.009248 s, 0.008901 s, -0.000347 s, × 0.9625, 6 µs/rev
netbeans x000_revs_x000_added_x_copies e2063d266acd 6081d72689dc : 1533 revs, 0.015446 s, 0.014333 s, -0.001113 s, × 0.9279, 9 µs/rev
netbeans x000_revs_x000_added_x000_copies ff453e9fee32 411350406ec2 : 5750 revs, 0.074373 s, 0.071998 s, -0.002375 s, × 0.9681, 12 µs/rev
netbeans x0000_revs_xx000_added_x000_copies 588c2d1ced70 1aad62e59ddd : 66949 revs, 0.639870 s, 0.615346 s, -0.024524 s, × 0.9617, 9 µs/rev
mozilla-central x_revs_x_added_0_copies 3697f962bb7b 7015fcdd43a2 : 2 revs, 0.000088 s, 0.000085 s, -0.000003 s, × 0.9659, 42 µs/rev
mozilla-central x_revs_x000_added_0_copies dd390860c6c9 40d0c5bed75d : 8 revs, 0.000199 s, 0.000199 s, +0.000000 s, × 1.0000, 24 µs/rev
mozilla-central x_revs_x_added_x_copies 8d198483ae3b 14207ffc2b2f : 9 revs, 0.000171 s, 0.000169 s, -0.000002 s, × 0.9883, 18 µs/rev
mozilla-central x_revs_x00_added_x_copies 98cbc58cc6bc 446a150332c3 : 7 revs, 0.000592 s, 0.000590 s, -0.000002 s, × 0.9966, 84 µs/rev
mozilla-central x_revs_x000_added_x000_copies 3c684b4b8f68 0a5e72d1b479 : 3 revs, 0.003151 s, 0.003122 s, -0.000029 s, × 0.9908, 1040 µs/rev
mozilla-central x_revs_x0000_added_x0000_copies effb563bb7e5 c07a39dc4e80 : 6 revs, 0.061612 s, 0.061192 s, -0.000420 s, × 0.9932, 10198 µs/rev
mozilla-central x000_revs_xx00_added_0_copies 6100d773079a 04a55431795e : 1593 revs, 0.005381 s, 0.005137 s, -0.000244 s, × 0.9547, 3 µs/rev
mozilla-central x000_revs_x000_added_x_copies 9f17a6fc04f9 2d37b966abed : 41 revs, 0.003742 s, 0.003585 s, -0.000157 s, × 0.9580, 87 µs/rev
mozilla-central x000_revs_x000_added_x000_copies 7c97034feb78 4407bd0c6330 : 7839 revs, 0.061983 s, 0.060592 s, -0.001391 s, × 0.9776, 7 µs/rev
mozilla-central x0000_revs_xx000_added_0_copies 9eec5917337d 67118cc6dcad : 615 revs, 0.019861 s, 0.019596 s, -0.000265 s, × 0.9867, 31 µs/rev
mozilla-central x0000_revs_xx000_added_x000_copies f78c615a656c 96a38b690156 : 30263 revs, 0.188101 s, 0.183558 s, -0.004543 s, × 0.9758, 6 µs/rev
mozilla-central x00000_revs_x0000_added_x0000_copies 6832ae71433c 4c222a1d9a00 : 153721 revs, 1.806696 s, 1.758083 s, -0.048613 s, × 0.9731, 11 µs/rev
mozilla-central x00000_revs_x00000_added_x000_copies 76caed42cf7c 1daa622bbe42 : 204976 revs, 2.682987 s, 2.592955 s, -0.090032 s, × 0.9664, 12 µs/rev
mozilla-try x_revs_x_added_0_copies aaf6dde0deb8 9790f499805a : 2 revs, 0.000852 s, 0.000844 s, -0.000008 s, × 0.9906, 422 µs/rev
mozilla-try x_revs_x000_added_0_copies d8d0222927b4 5bb8ce8c7450 : 2 revs, 0.000859 s, 0.000861 s, +0.000002 s, × 1.0023, 430 µs/rev
mozilla-try x_revs_x_added_x_copies 092fcca11bdb 936255a0384a : 4 revs, 0.000150 s, 0.000150 s, +0.000000 s, × 1.0000, 37 µs/rev
mozilla-try x_revs_x00_added_x_copies b53d2fadbdb5 017afae788ec : 2 revs, 0.001158 s, 0.001166 s, +0.000008 s, × 1.0069, 583 µs/rev
mozilla-try x_revs_x000_added_x000_copies 20408ad61ce5 6f0ee96e21ad : 1 revs, 0.027240 s, 0.027359 s, +0.000119 s, × 1.0044, 27359 µs/rev
mozilla-try x_revs_x0000_added_x0000_copies effb563bb7e5 c07a39dc4e80 : 6 revs, 0.062824 s, 0.061848 s, -0.000976 s, × 0.9845, 10308 µs/rev
mozilla-try x000_revs_xx00_added_0_copies 6100d773079a 04a55431795e : 1593 revs, 0.005463 s, 0.005110 s, -0.000353 s, × 0.9354, 3 µs/rev
mozilla-try x000_revs_x000_added_x_copies 9f17a6fc04f9 2d37b966abed : 41 revs, 0.004238 s, 0.004168 s, -0.000070 s, × 0.9835, 101 µs/rev
mozilla-try x000_revs_x000_added_x000_copies 1346fd0130e4 4c65cbdabc1f : 6657 revs, 0.064113 s, 0.063414 s, -0.000699 s, × 0.9891, 9 µs/rev
mozilla-try x0000_revs_x_added_0_copies 63519bfd42ee a36a2a865d92 : 40314 revs, 0.294063 s, 0.288301 s, -0.005762 s, × 0.9804, 7 µs/rev
mozilla-try x0000_revs_x_added_x_copies 9fe69ff0762d bcabf2a78927 : 38690 revs, 0.281493 s, 0.275798 s, -0.005695 s, × 0.9798, 7 µs/rev
mozilla-try x0000_revs_xx000_added_x_copies 156f6e2674f2 4d0f2c178e66 : 8598 revs, 0.076323 s, 0.074640 s, -0.001683 s, × 0.9779, 8 µs/rev
mozilla-try x0000_revs_xx000_added_0_copies 9eec5917337d 67118cc6dcad : 615 revs, 0.020390 s, 0.020327 s, -0.000063 s, × 0.9969, 33 µs/rev
mozilla-try x0000_revs_xx000_added_x000_copies 89294cd501d9 7ccb2fc7ccb5 : 97052 revs, 3.023879 s, 2.970385 s, -0.053494 s, × 0.9823, 30 µs/rev
mozilla-try x0000_revs_x0000_added_x0000_copies e928c65095ed e951f4ad123a : 52031 revs, 0.735549 s, 0.719432 s, -0.016117 s, × 0.9781, 13 µs/rev
mozilla-try x00000_revs_x_added_0_copies 6a320851d377 1ebb79acd503 : 363753 revs, 18.568900 s, 18.165143 s, -0.403757 s, × 0.9783, 49 µs/rev
mozilla-try x00000_revs_x00000_added_0_copies dc8a3ca7010e d16fde900c9c : 34414 revs, 0.502584 s, 0.486769 s, -0.015815 s, × 0.9685, 14 µs/rev
mozilla-try x00000_revs_x_added_x_copies 5173c4b6f97c 95d83ee7242d : 362229 revs, 18.356645 s, 17.913924 s, -0.442721 s, × 0.9759, 49 µs/rev
mozilla-try x00000_revs_x000_added_x_copies 9126823d0e9c ca82787bb23c : 359344 revs, 18.250393 s, 17.660113 s, -0.590280 s, × 0.9677, 49 µs/rev
mozilla-try x00000_revs_x0000_added_x0000_copies 8d3fafa80d4b eb884023b810 : 192665 revs, 2.792459 s, 2.709446 s, -0.083013 s, × 0.9703, 14 µs/rev
mozilla-try x00000_revs_x00000_added_x0000_copies 1b661134e2ca 1ae03d022d6d : 228985 revs, 107.697264 s, 107.796891 s, +0.099627 s, × 1.0009, 470 µs/rev
mozilla-try x00000_revs_x00000_added_x000_copies 9b2a99adc05e 8e29777b48e6 : 382065 revs, 63.961040 s, 63.575217 s, -0.385823 s, × 0.9940, 166 µs/rev
Differential Revision: https://phab.mercurial-scm.org/D9423
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 20 Nov 2020 13:46:14 +0100 |
parents | e641bb2a6159 |
children | d4ba4d51f85f |
rev | line source |
---|---|
5775
2dd202a6e15b
bisect: make bisect a built-in command
Matt Mackall <mpm@selenic.com>
parents:
5774
diff
changeset
|
1 # changelog bisection for mercurial |
1367
a7678cbd7c28
bisect extension for mercurial
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
2 # |
5775
2dd202a6e15b
bisect: make bisect a built-in command
Matt Mackall <mpm@selenic.com>
parents:
5774
diff
changeset
|
3 # Copyright 2007 Matt Mackall |
1861
65949d1c9bf7
Added copyright information to hbisect.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1856
diff
changeset
|
4 # Copyright 2005, 2006 Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
8228
eee2319c5895
add blank line after copyright notices and after header
Martin Geisler <mg@lazybytes.net>
parents:
8225
diff
changeset
|
5 # |
1861
65949d1c9bf7
Added copyright information to hbisect.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1856
diff
changeset
|
6 # Inspired by git bisect, extension skeleton taken from mq.py. |
65949d1c9bf7
Added copyright information to hbisect.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1856
diff
changeset
|
7 # |
8225
46293a0c7e9f
updated license to be explicit about GPL version 2
Martin Geisler <mg@lazybytes.net>
parents:
8152
diff
changeset
|
8 # This software may be used and distributed according to the terms of the |
10263 | 9 # GNU General Public License version 2 or any later version. |
1367
a7678cbd7c28
bisect extension for mercurial
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
10 |
25952
f0ad094db832
hbisect: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25113
diff
changeset
|
11 from __future__ import absolute_import |
f0ad094db832
hbisect: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25113
diff
changeset
|
12 |
25113
0ca8410ea345
util: drop alias for collections.deque
Martin von Zweigbergk <martinvonz@google.com>
parents:
23877
diff
changeset
|
13 import collections |
43665
f37da59a36d9
bisect: replace try:/finally: by a "restore_state" context manager
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43077
diff
changeset
|
14 import contextlib |
25952
f0ad094db832
hbisect: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25113
diff
changeset
|
15 |
f0ad094db832
hbisect: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25113
diff
changeset
|
16 from .i18n import _ |
f0ad094db832
hbisect: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25113
diff
changeset
|
17 from .node import ( |
f0ad094db832
hbisect: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25113
diff
changeset
|
18 hex, |
f0ad094db832
hbisect: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25113
diff
changeset
|
19 short, |
f0ad094db832
hbisect: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25113
diff
changeset
|
20 ) |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
21 from . import error |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
22 |
1367
a7678cbd7c28
bisect extension for mercurial
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
23 |
35128
fd8b6b183073
hbisect: pass repo into hbisect.bisect
David Soria Parra <davidsp@fb.com>
parents:
30389
diff
changeset
|
24 def bisect(repo, state): |
6858
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
25 """find the next node (if any) for testing during a bisect search. |
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
26 returns a (nodes, number, good) tuple. |
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
27 |
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
28 'nodes' is the final result of the bisect if 'number' is 0. |
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
29 Otherwise 'number' indicates the remaining possible candidates for |
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
30 the search and 'nodes' contains the next bisect target. |
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
31 'good' is True if bisect is searching for a first good changeset, False |
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
32 if searching for a first bad one. |
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
33 """ |
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
34 |
42310
21eda240be07
bisect: do not crash with rewritten commits
timeless <timeless@mozdev.org>
parents:
42057
diff
changeset
|
35 repo = repo.unfiltered() |
35128
fd8b6b183073
hbisect: pass repo into hbisect.bisect
David Soria Parra <davidsp@fb.com>
parents:
30389
diff
changeset
|
36 changelog = repo.changelog |
5737 | 37 clparents = changelog.parentrevs |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
38 skip = {changelog.rev(n) for n in state[b'skip']} |
1367
a7678cbd7c28
bisect extension for mercurial
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
39 |
5776
35ec669cdd43
bisect: handle search for bad to good transitions
Matt Mackall <mpm@selenic.com>
parents:
5775
diff
changeset
|
40 def buildancestors(bad, good): |
35ec669cdd43
bisect: handle search for bad to good transitions
Matt Mackall <mpm@selenic.com>
parents:
5775
diff
changeset
|
41 badrev = min([changelog.rev(n) for n in bad]) |
35130
8287df8b7be5
hbisect: use a defaultdict to avoid large allocations for a large changelogs
David Soria Parra <davidsp@fb.com>
parents:
35129
diff
changeset
|
42 ancestors = collections.defaultdict(lambda: None) |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
43 for rev in repo.revs(b"descendants(%ln) - ancestors(%ln)", good, good): |
14895
a35d6f822e3e
hbisect: do not assume that min(good) is an ancestor of min(bad)
Alexander Krauss <krauss@in.tum.de>
parents:
14894
diff
changeset
|
44 ancestors[rev] = [] |
5776
35ec669cdd43
bisect: handle search for bad to good transitions
Matt Mackall <mpm@selenic.com>
parents:
5775
diff
changeset
|
45 if ancestors[badrev] is None: |
5777 | 46 return badrev, None |
5776
35ec669cdd43
bisect: handle search for bad to good transitions
Matt Mackall <mpm@selenic.com>
parents:
5775
diff
changeset
|
47 return badrev, ancestors |
35ec669cdd43
bisect: handle search for bad to good transitions
Matt Mackall <mpm@selenic.com>
parents:
5775
diff
changeset
|
48 |
14215
e5a59d31bb04
hbisect: use real Booleans instead of 0/1
Martin Geisler <mg@aragost.com>
parents:
12067
diff
changeset
|
49 good = False |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
50 badrev, ancestors = buildancestors(state[b'bad'], state[b'good']) |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
51 if not ancestors: # looking for bad to good transition? |
14215
e5a59d31bb04
hbisect: use real Booleans instead of 0/1
Martin Geisler <mg@aragost.com>
parents:
12067
diff
changeset
|
52 good = True |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
53 badrev, ancestors = buildancestors(state[b'good'], state[b'bad']) |
5777 | 54 bad = changelog.node(badrev) |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
55 if not ancestors: # now we're confused |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
56 if ( |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
57 len(state[b'bad']) == 1 |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
58 and len(state[b'good']) == 1 |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
59 and state[b'bad'] != state[b'good'] |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
60 ): |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
61 raise error.Abort(_(b"starting revisions are not directly related")) |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
62 raise error.Abort( |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
63 _(b"inconsistent state, %d:%s is good and bad") |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
64 % (badrev, short(bad)) |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
65 ) |
5723
e3b09819496b
bisect: switch to rev-based calculation
Matt Mackall <mpm@selenic.com>
parents:
5722
diff
changeset
|
66 |
5768
78d14403bdc7
bisect: use a dict for children
Matt Mackall <mpm@selenic.com>
parents:
5767
diff
changeset
|
67 # build children dict |
78d14403bdc7
bisect: use a dict for children
Matt Mackall <mpm@selenic.com>
parents:
5767
diff
changeset
|
68 children = {} |
25113
0ca8410ea345
util: drop alias for collections.deque
Martin von Zweigbergk <martinvonz@google.com>
parents:
23877
diff
changeset
|
69 visit = collections.deque([badrev]) |
5769
49809f4a38d8
bisect: calculate candidate set while finding children
Matt Mackall <mpm@selenic.com>
parents:
5768
diff
changeset
|
70 candidates = [] |
5768
78d14403bdc7
bisect: use a dict for children
Matt Mackall <mpm@selenic.com>
parents:
5767
diff
changeset
|
71 while visit: |
16803
107a3270a24a
cleanup: use the deque type where appropriate
Bryan O'Sullivan <bryano@fb.com>
parents:
16647
diff
changeset
|
72 rev = visit.popleft() |
5767
dd5f8ed31057
bisect: propagate ancestor lists directly to children
Matt Mackall <mpm@selenic.com>
parents:
5766
diff
changeset
|
73 if ancestors[rev] == []: |
5769
49809f4a38d8
bisect: calculate candidate set while finding children
Matt Mackall <mpm@selenic.com>
parents:
5768
diff
changeset
|
74 candidates.append(rev) |
5767
dd5f8ed31057
bisect: propagate ancestor lists directly to children
Matt Mackall <mpm@selenic.com>
parents:
5766
diff
changeset
|
75 for prev in clparents(rev): |
5768
78d14403bdc7
bisect: use a dict for children
Matt Mackall <mpm@selenic.com>
parents:
5767
diff
changeset
|
76 if prev != -1: |
78d14403bdc7
bisect: use a dict for children
Matt Mackall <mpm@selenic.com>
parents:
5767
diff
changeset
|
77 if prev in children: |
78d14403bdc7
bisect: use a dict for children
Matt Mackall <mpm@selenic.com>
parents:
5767
diff
changeset
|
78 children[prev].append(rev) |
78d14403bdc7
bisect: use a dict for children
Matt Mackall <mpm@selenic.com>
parents:
5767
diff
changeset
|
79 else: |
78d14403bdc7
bisect: use a dict for children
Matt Mackall <mpm@selenic.com>
parents:
5767
diff
changeset
|
80 children[prev] = [rev] |
78d14403bdc7
bisect: use a dict for children
Matt Mackall <mpm@selenic.com>
parents:
5767
diff
changeset
|
81 visit.append(prev) |
5767
dd5f8ed31057
bisect: propagate ancestor lists directly to children
Matt Mackall <mpm@selenic.com>
parents:
5766
diff
changeset
|
82 |
5769
49809f4a38d8
bisect: calculate candidate set while finding children
Matt Mackall <mpm@selenic.com>
parents:
5768
diff
changeset
|
83 candidates.sort() |
5770
f5b858fc8067
bisect: find best node in ancestor collection pass
Matt Mackall <mpm@selenic.com>
parents:
5769
diff
changeset
|
84 # have we narrowed it down to one entry? |
6858
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
85 # or have all other possible candidates besides 'bad' have been skipped? |
5770
f5b858fc8067
bisect: find best node in ancestor collection pass
Matt Mackall <mpm@selenic.com>
parents:
5769
diff
changeset
|
86 tot = len(candidates) |
6858
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
87 unskipped = [c for c in candidates if (c not in skip) and (c != badrev)] |
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
88 if tot == 1 or not unskipped: |
30389
e124e83fd159
hbisect: avoid shadowing a variable in a list comprehension
Augie Fackler <augie@google.com>
parents:
30126
diff
changeset
|
89 return ([changelog.node(c) for c in candidates], 0, good) |
7902
afddc32b2b3f
bisect: use integer division
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
7557
diff
changeset
|
90 perfect = tot // 2 |
5769
49809f4a38d8
bisect: calculate candidate set while finding children
Matt Mackall <mpm@selenic.com>
parents:
5768
diff
changeset
|
91 |
5770
f5b858fc8067
bisect: find best node in ancestor collection pass
Matt Mackall <mpm@selenic.com>
parents:
5769
diff
changeset
|
92 # find the best node to test |
f5b858fc8067
bisect: find best node in ancestor collection pass
Matt Mackall <mpm@selenic.com>
parents:
5769
diff
changeset
|
93 best_rev = None |
f5b858fc8067
bisect: find best node in ancestor collection pass
Matt Mackall <mpm@selenic.com>
parents:
5769
diff
changeset
|
94 best_len = -1 |
8463
43186df4bb8e
bisect: use set instead of dict
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8228
diff
changeset
|
95 poison = set() |
5769
49809f4a38d8
bisect: calculate candidate set while finding children
Matt Mackall <mpm@selenic.com>
parents:
5768
diff
changeset
|
96 for rev in candidates: |
5772
4c46636eafe5
bisect: skip calculations on candidates with too many ancestors
Matt Mackall <mpm@selenic.com>
parents:
5771
diff
changeset
|
97 if rev in poison: |
8482
fc27c91fff2c
hbisect: use set.update for bulk updates
Martin Geisler <mg@lazybytes.net>
parents:
8463
diff
changeset
|
98 # poison children |
fc27c91fff2c
hbisect: use set.update for bulk updates
Martin Geisler <mg@lazybytes.net>
parents:
8463
diff
changeset
|
99 poison.update(children.get(rev, [])) |
5772
4c46636eafe5
bisect: skip calculations on candidates with too many ancestors
Matt Mackall <mpm@selenic.com>
parents:
5771
diff
changeset
|
100 continue |
5773
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
101 |
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
102 a = ancestors[rev] or [rev] |
5770
f5b858fc8067
bisect: find best node in ancestor collection pass
Matt Mackall <mpm@selenic.com>
parents:
5769
diff
changeset
|
103 ancestors[rev] = None |
5773
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
104 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
105 x = len(a) # number of ancestors |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
106 y = tot - x # number of non-ancestors |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
107 value = min(x, y) # how good is this test? |
5773
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
108 if value > best_len and rev not in skip: |
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
109 best_len = value |
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
110 best_rev = rev |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
111 if value == perfect: # found a perfect candidate? quit early |
5773
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
112 break |
5772
4c46636eafe5
bisect: skip calculations on candidates with too many ancestors
Matt Mackall <mpm@selenic.com>
parents:
5771
diff
changeset
|
113 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
114 if y < perfect and rev not in skip: # all downhill from here? |
8482
fc27c91fff2c
hbisect: use set.update for bulk updates
Martin Geisler <mg@lazybytes.net>
parents:
8463
diff
changeset
|
115 # poison children |
fc27c91fff2c
hbisect: use set.update for bulk updates
Martin Geisler <mg@lazybytes.net>
parents:
8463
diff
changeset
|
116 poison.update(children.get(rev, [])) |
5773
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
117 continue |
5772
4c46636eafe5
bisect: skip calculations on candidates with too many ancestors
Matt Mackall <mpm@selenic.com>
parents:
5771
diff
changeset
|
118 |
5773
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
119 for c in children.get(rev, []): |
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
120 if ancestors[c]: |
8152
08e1baf924ca
replace set-like dictionaries with real sets
Martin Geisler <mg@lazybytes.net>
parents:
8109
diff
changeset
|
121 ancestors[c] = list(set(ancestors[c] + a)) |
5773
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
122 else: |
2f6105ab4c54
bisect: merge ancestor lists when pushing to children
Matt Mackall <mpm@selenic.com>
parents:
5772
diff
changeset
|
123 ancestors[c] = a + [c] |
5734
944b231fa0e7
bisect: move reporting out of core bisect function
Matt Mackall <mpm@selenic.com>
parents:
5733
diff
changeset
|
124 |
5737 | 125 assert best_rev is not None |
126 best_node = changelog.node(best_rev) | |
1367
a7678cbd7c28
bisect extension for mercurial
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
127 |
6858
8f256bf98219
Add support for multiple possible bisect results (issue1228, issue1182)
Bernhard Leiner <bleiner@gmail.com>
parents:
6217
diff
changeset
|
128 return ([best_node], tot, good) |
7227
e1afb50ec2aa
bisect: ability to check revision with command
Alexander Solovyov <piranha@piranha.org.ua>
parents:
6861
diff
changeset
|
129 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
130 |
30066
5f93737d0ba8
bisect: move the 'extendrange' to the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30065
diff
changeset
|
131 def extendrange(repo, state, nodes, good): |
5f93737d0ba8
bisect: move the 'extendrange' to the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30065
diff
changeset
|
132 # bisect is incomplete when it ends on a merge node and |
5f93737d0ba8
bisect: move the 'extendrange' to the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30065
diff
changeset
|
133 # one of the parent was not checked. |
5f93737d0ba8
bisect: move the 'extendrange' to the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30065
diff
changeset
|
134 parents = repo[nodes[0]].parents() |
5f93737d0ba8
bisect: move the 'extendrange' to the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30065
diff
changeset
|
135 if len(parents) > 1: |
5f93737d0ba8
bisect: move the 'extendrange' to the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30065
diff
changeset
|
136 if good: |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
137 side = state[b'bad'] |
30066
5f93737d0ba8
bisect: move the 'extendrange' to the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30065
diff
changeset
|
138 else: |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
139 side = state[b'good'] |
44452
9d2b2df2c2ba
cleanup: run pyupgrade on our source tree to clean up varying things
Augie Fackler <augie@google.com>
parents:
43665
diff
changeset
|
140 num = len({i.node() for i in parents} & set(side)) |
30066
5f93737d0ba8
bisect: move the 'extendrange' to the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30065
diff
changeset
|
141 if num == 1: |
5f93737d0ba8
bisect: move the 'extendrange' to the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30065
diff
changeset
|
142 return parents[0].ancestor(parents[1]) |
5f93737d0ba8
bisect: move the 'extendrange' to the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30065
diff
changeset
|
143 return None |
7227
e1afb50ec2aa
bisect: ability to check revision with command
Alexander Solovyov <piranha@piranha.org.ua>
parents:
6861
diff
changeset
|
144 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
145 |
7227
e1afb50ec2aa
bisect: ability to check revision with command
Alexander Solovyov <piranha@piranha.org.ua>
parents:
6861
diff
changeset
|
146 def load_state(repo): |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
147 state = {b'current': [], b'good': [], b'bad': [], b'skip': []} |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
148 for l in repo.vfs.tryreadlines(b"bisect.state"): |
27525
cba62f996780
hbisect: use tryreadlines to load state
Bryan O'Sullivan <bos@serpentine.com>
parents:
26587
diff
changeset
|
149 kind, node = l[:-1].split() |
42310
21eda240be07
bisect: do not crash with rewritten commits
timeless <timeless@mozdev.org>
parents:
42057
diff
changeset
|
150 node = repo.unfiltered().lookup(node) |
27525
cba62f996780
hbisect: use tryreadlines to load state
Bryan O'Sullivan <bos@serpentine.com>
parents:
26587
diff
changeset
|
151 if kind not in state: |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
152 raise error.Abort(_(b"unknown bisect kind %s") % kind) |
27525
cba62f996780
hbisect: use tryreadlines to load state
Bryan O'Sullivan <bos@serpentine.com>
parents:
26587
diff
changeset
|
153 state[kind].append(node) |
7227
e1afb50ec2aa
bisect: ability to check revision with command
Alexander Solovyov <piranha@piranha.org.ua>
parents:
6861
diff
changeset
|
154 return state |
e1afb50ec2aa
bisect: ability to check revision with command
Alexander Solovyov <piranha@piranha.org.ua>
parents:
6861
diff
changeset
|
155 |
e1afb50ec2aa
bisect: ability to check revision with command
Alexander Solovyov <piranha@piranha.org.ua>
parents:
6861
diff
changeset
|
156 |
e1afb50ec2aa
bisect: ability to check revision with command
Alexander Solovyov <piranha@piranha.org.ua>
parents:
6861
diff
changeset
|
157 def save_state(repo, state): |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
158 f = repo.vfs(b"bisect.state", b"w", atomictemp=True) |
27853
9b8a5c6ac176
with: use context manager in bisect save_state
Bryan O'Sullivan <bryano@fb.com>
parents:
27525
diff
changeset
|
159 with repo.wlock(): |
18358
93293813d753
bisect: store state sorted
Mads Kiilerich <mads@kiilerich.com>
parents:
17537
diff
changeset
|
160 for kind in sorted(state): |
7227
e1afb50ec2aa
bisect: ability to check revision with command
Alexander Solovyov <piranha@piranha.org.ua>
parents:
6861
diff
changeset
|
161 for node in state[kind]: |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
162 f.write(b"%s %s\n" % (kind, hex(node))) |
15057
774da7121fc9
atomictempfile: make close() consistent with other file-like objects.
Greg Ward <greg@gerg.ca>
parents:
14895
diff
changeset
|
163 f.close() |
7227
e1afb50ec2aa
bisect: ability to check revision with command
Alexander Solovyov <piranha@piranha.org.ua>
parents:
6861
diff
changeset
|
164 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
165 |
30065
ee21ed7fc7a2
bisect: extract the 'reset' logic into its own function
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
27853
diff
changeset
|
166 def resetstate(repo): |
ee21ed7fc7a2
bisect: extract the 'reset' logic into its own function
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
27853
diff
changeset
|
167 """remove any bisect state from the repository""" |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
168 if repo.vfs.exists(b"bisect.state"): |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
169 repo.vfs.unlink(b"bisect.state") |
30065
ee21ed7fc7a2
bisect: extract the 'reset' logic into its own function
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
27853
diff
changeset
|
170 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
171 |
30126
755730fc1e48
bisect: move check_state into the bisect module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30067
diff
changeset
|
172 def checkstate(state): |
755730fc1e48
bisect: move check_state into the bisect module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30067
diff
changeset
|
173 """check we have both 'good' and 'bad' to define a range |
755730fc1e48
bisect: move check_state into the bisect module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30067
diff
changeset
|
174 |
45875
e641bb2a6159
errors: raise StateError in `hg bisect`
Martin von Zweigbergk <martinvonz@google.com>
parents:
44452
diff
changeset
|
175 Raise StateError exception otherwise.""" |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
176 if state[b'good'] and state[b'bad']: |
30126
755730fc1e48
bisect: move check_state into the bisect module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30067
diff
changeset
|
177 return True |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
178 if not state[b'good']: |
45875
e641bb2a6159
errors: raise StateError in `hg bisect`
Martin von Zweigbergk <martinvonz@google.com>
parents:
44452
diff
changeset
|
179 raise error.StateError(_(b'cannot bisect (no known good revisions)')) |
30126
755730fc1e48
bisect: move check_state into the bisect module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30067
diff
changeset
|
180 else: |
45875
e641bb2a6159
errors: raise StateError in `hg bisect`
Martin von Zweigbergk <martinvonz@google.com>
parents:
44452
diff
changeset
|
181 raise error.StateError(_(b'cannot bisect (no known bad revisions)')) |
30126
755730fc1e48
bisect: move check_state into the bisect module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30067
diff
changeset
|
182 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
183 |
43665
f37da59a36d9
bisect: replace try:/finally: by a "restore_state" context manager
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43077
diff
changeset
|
184 @contextlib.contextmanager |
f37da59a36d9
bisect: replace try:/finally: by a "restore_state" context manager
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43077
diff
changeset
|
185 def restore_state(repo, state, node): |
f37da59a36d9
bisect: replace try:/finally: by a "restore_state" context manager
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43077
diff
changeset
|
186 try: |
f37da59a36d9
bisect: replace try:/finally: by a "restore_state" context manager
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43077
diff
changeset
|
187 yield |
f37da59a36d9
bisect: replace try:/finally: by a "restore_state" context manager
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43077
diff
changeset
|
188 finally: |
f37da59a36d9
bisect: replace try:/finally: by a "restore_state" context manager
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43077
diff
changeset
|
189 state[b'current'] = [node] |
f37da59a36d9
bisect: replace try:/finally: by a "restore_state" context manager
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43077
diff
changeset
|
190 save_state(repo, state) |
f37da59a36d9
bisect: replace try:/finally: by a "restore_state" context manager
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43077
diff
changeset
|
191 |
f37da59a36d9
bisect: replace try:/finally: by a "restore_state" context manager
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43077
diff
changeset
|
192 |
15135
f19de58af225
revset.bisect: move bisect() code to hbisect.py
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15057
diff
changeset
|
193 def get(repo, status): |
f19de58af225
revset.bisect: move bisect() code to hbisect.py
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15057
diff
changeset
|
194 """ |
f19de58af225
revset.bisect: move bisect() code to hbisect.py
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15057
diff
changeset
|
195 Return a list of revision(s) that match the given status: |
f19de58af225
revset.bisect: move bisect() code to hbisect.py
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15057
diff
changeset
|
196 |
15153
fa0a464e4ca5
hbisect: add two new revset descriptions: 'goods' and 'bads'
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15147
diff
changeset
|
197 - ``good``, ``bad``, ``skip``: csets explicitly marked as good/bad/skip |
17424
e7cfe3587ea4
fix trivial spelling errors
Mads Kiilerich <mads@kiilerich.com>
parents:
16834
diff
changeset
|
198 - ``goods``, ``bads`` : csets topologically good/bad |
15153
fa0a464e4ca5
hbisect: add two new revset descriptions: 'goods' and 'bads'
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15147
diff
changeset
|
199 - ``range`` : csets taking part in the bisection |
fa0a464e4ca5
hbisect: add two new revset descriptions: 'goods' and 'bads'
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15147
diff
changeset
|
200 - ``pruned`` : csets that are goods, bads or skipped |
15138
883d28233a4d
revset.bisect: add new 'untested' set to the bisect keyword
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15137
diff
changeset
|
201 - ``untested`` : csets whose fate is yet unknown |
15147
395ca8cd2669
revset.bisect: add 'ignored' set to the bisect keyword
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15146
diff
changeset
|
202 - ``ignored`` : csets ignored due to DAG topology |
16647
14913fcb30c6
bisect: track the current changeset (issue3382)
Bryan O'Sullivan <bryano@fb.com>
parents:
15406
diff
changeset
|
203 - ``current`` : the cset currently being bisected |
15135
f19de58af225
revset.bisect: move bisect() code to hbisect.py
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15057
diff
changeset
|
204 """ |
f19de58af225
revset.bisect: move bisect() code to hbisect.py
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15057
diff
changeset
|
205 state = load_state(repo) |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
206 if status in (b'good', b'bad', b'skip', b'current'): |
42310
21eda240be07
bisect: do not crash with rewritten commits
timeless <timeless@mozdev.org>
parents:
42057
diff
changeset
|
207 return map(repo.unfiltered().changelog.rev, state[status]) |
15135
f19de58af225
revset.bisect: move bisect() code to hbisect.py
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15057
diff
changeset
|
208 else: |
17493 | 209 # In the following sets, we do *not* call 'bisect()' with more |
17509 | 210 # than one level of recursion, because that can be very, very |
15146
b39d85be78a8
hbisect.get: use simpler code with repo.set(), fix 'pruned' set
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15138
diff
changeset
|
211 # time consuming. Instead, we always develop the expression as |
b39d85be78a8
hbisect.get: use simpler code with repo.set(), fix 'pruned' set
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15138
diff
changeset
|
212 # much as possible. |
b39d85be78a8
hbisect.get: use simpler code with repo.set(), fix 'pruned' set
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15138
diff
changeset
|
213 |
b39d85be78a8
hbisect.get: use simpler code with repo.set(), fix 'pruned' set
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15138
diff
changeset
|
214 # 'range' is all csets that make the bisection: |
b39d85be78a8
hbisect.get: use simpler code with repo.set(), fix 'pruned' set
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15138
diff
changeset
|
215 # - have a good ancestor and a bad descendant, or conversely |
b39d85be78a8
hbisect.get: use simpler code with repo.set(), fix 'pruned' set
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15138
diff
changeset
|
216 # that's because the bisection can go either way |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
217 range = b'( bisect(bad)::bisect(good) | bisect(good)::bisect(bad) )' |
15136
18219c0789ae
revset.bisect: add new 'range' set to the bisect keyword
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15135
diff
changeset
|
218 |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
219 _t = repo.revs(b'bisect(good)::bisect(bad)') |
15153
fa0a464e4ca5
hbisect: add two new revset descriptions: 'goods' and 'bads'
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15147
diff
changeset
|
220 # The sets of topologically good or bad csets |
fa0a464e4ca5
hbisect: add two new revset descriptions: 'goods' and 'bads'
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15147
diff
changeset
|
221 if len(_t) == 0: |
fa0a464e4ca5
hbisect: add two new revset descriptions: 'goods' and 'bads'
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15147
diff
changeset
|
222 # Goods are topologically after bads |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
223 goods = b'bisect(good)::' # Pruned good csets |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
224 bads = b'::bisect(bad)' # Pruned bad csets |
15153
fa0a464e4ca5
hbisect: add two new revset descriptions: 'goods' and 'bads'
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15147
diff
changeset
|
225 else: |
fa0a464e4ca5
hbisect: add two new revset descriptions: 'goods' and 'bads'
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15147
diff
changeset
|
226 # Goods are topologically before bads |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
227 goods = b'::bisect(good)' # Pruned good csets |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
228 bads = b'bisect(bad)::' # Pruned bad csets |
15153
fa0a464e4ca5
hbisect: add two new revset descriptions: 'goods' and 'bads'
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15147
diff
changeset
|
229 |
fa0a464e4ca5
hbisect: add two new revset descriptions: 'goods' and 'bads'
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15147
diff
changeset
|
230 # 'pruned' is all csets whose fate is already known: good, bad, skip |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
231 skips = b'bisect(skip)' # Pruned skipped csets |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
232 pruned = b'( (%s) | (%s) | (%s) )' % (goods, bads, skips) |
15136
18219c0789ae
revset.bisect: add new 'range' set to the bisect keyword
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15135
diff
changeset
|
233 |
15146
b39d85be78a8
hbisect.get: use simpler code with repo.set(), fix 'pruned' set
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15138
diff
changeset
|
234 # 'untested' is all cset that are- in 'range', but not in 'pruned' |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
235 untested = b'( (%s) - (%s) )' % (range, pruned) |
15136
18219c0789ae
revset.bisect: add new 'range' set to the bisect keyword
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15135
diff
changeset
|
236 |
15147
395ca8cd2669
revset.bisect: add 'ignored' set to the bisect keyword
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15146
diff
changeset
|
237 # 'ignored' is all csets that were not used during the bisection |
395ca8cd2669
revset.bisect: add 'ignored' set to the bisect keyword
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15146
diff
changeset
|
238 # due to DAG topology, but may however have had an impact. |
17424
e7cfe3587ea4
fix trivial spelling errors
Mads Kiilerich <mads@kiilerich.com>
parents:
16834
diff
changeset
|
239 # E.g., a branch merged between bads and goods, but whose branch- |
15147
395ca8cd2669
revset.bisect: add 'ignored' set to the bisect keyword
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15146
diff
changeset
|
240 # point is out-side of the range. |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
241 iba = b'::bisect(bad) - ::bisect(good)' # Ignored bads' ancestors |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
242 iga = b'::bisect(good) - ::bisect(bad)' # Ignored goods' ancestors |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
243 ignored = b'( ( (%s) | (%s) ) - (%s) )' % (iba, iga, range) |
15147
395ca8cd2669
revset.bisect: add 'ignored' set to the bisect keyword
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15146
diff
changeset
|
244 |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
245 if status == b'range': |
15404
c1eb8398fe82
localrepo: convert various repo.set() users to repo.revs()
Matt Mackall <mpm@selenic.com>
parents:
15308
diff
changeset
|
246 return repo.revs(range) |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
247 elif status == b'pruned': |
15404
c1eb8398fe82
localrepo: convert various repo.set() users to repo.revs()
Matt Mackall <mpm@selenic.com>
parents:
15308
diff
changeset
|
248 return repo.revs(pruned) |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
249 elif status == b'untested': |
15404
c1eb8398fe82
localrepo: convert various repo.set() users to repo.revs()
Matt Mackall <mpm@selenic.com>
parents:
15308
diff
changeset
|
250 return repo.revs(untested) |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
251 elif status == b'ignored': |
15404
c1eb8398fe82
localrepo: convert various repo.set() users to repo.revs()
Matt Mackall <mpm@selenic.com>
parents:
15308
diff
changeset
|
252 return repo.revs(ignored) |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
253 elif status == b"goods": |
15404
c1eb8398fe82
localrepo: convert various repo.set() users to repo.revs()
Matt Mackall <mpm@selenic.com>
parents:
15308
diff
changeset
|
254 return repo.revs(goods) |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
255 elif status == b"bads": |
15404
c1eb8398fe82
localrepo: convert various repo.set() users to repo.revs()
Matt Mackall <mpm@selenic.com>
parents:
15308
diff
changeset
|
256 return repo.revs(bads) |
15136
18219c0789ae
revset.bisect: add new 'range' set to the bisect keyword
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15135
diff
changeset
|
257 else: |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
258 raise error.ParseError(_(b'invalid bisect state')) |
15154
aa2e908c521e
hbisect: add functions to return a label for a cset bisection status
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15153
diff
changeset
|
259 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
260 |
15406
1f677c7e494d
bisect: remove superfluous parameter in label()
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15404
diff
changeset
|
261 def label(repo, node): |
15154
aa2e908c521e
hbisect: add functions to return a label for a cset bisection status
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15153
diff
changeset
|
262 rev = repo.changelog.rev(node) |
aa2e908c521e
hbisect: add functions to return a label for a cset bisection status
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15153
diff
changeset
|
263 |
aa2e908c521e
hbisect: add functions to return a label for a cset bisection status
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15153
diff
changeset
|
264 # Try explicit sets |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
265 if rev in get(repo, b'good'): |
15308
ab341fbb05b1
bisect: add i18n contexts
Wagner Bruna <wbruna@softwareexpress.com.br>
parents:
15154
diff
changeset
|
266 # i18n: bisect changeset status |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
267 return _(b'good') |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
268 if rev in get(repo, b'bad'): |
15308
ab341fbb05b1
bisect: add i18n contexts
Wagner Bruna <wbruna@softwareexpress.com.br>
parents:
15154
diff
changeset
|
269 # i18n: bisect changeset status |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
270 return _(b'bad') |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
271 if rev in get(repo, b'skip'): |
15308
ab341fbb05b1
bisect: add i18n contexts
Wagner Bruna <wbruna@softwareexpress.com.br>
parents:
15154
diff
changeset
|
272 # i18n: bisect changeset status |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
273 return _(b'skipped') |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
274 if rev in get(repo, b'untested') or rev in get(repo, b'current'): |
15308
ab341fbb05b1
bisect: add i18n contexts
Wagner Bruna <wbruna@softwareexpress.com.br>
parents:
15154
diff
changeset
|
275 # i18n: bisect changeset status |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
276 return _(b'untested') |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
277 if rev in get(repo, b'ignored'): |
15308
ab341fbb05b1
bisect: add i18n contexts
Wagner Bruna <wbruna@softwareexpress.com.br>
parents:
15154
diff
changeset
|
278 # i18n: bisect changeset status |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
279 return _(b'ignored') |
15154
aa2e908c521e
hbisect: add functions to return a label for a cset bisection status
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15153
diff
changeset
|
280 |
aa2e908c521e
hbisect: add functions to return a label for a cset bisection status
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15153
diff
changeset
|
281 # Try implicit sets |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
282 if rev in get(repo, b'goods'): |
15308
ab341fbb05b1
bisect: add i18n contexts
Wagner Bruna <wbruna@softwareexpress.com.br>
parents:
15154
diff
changeset
|
283 # i18n: bisect changeset status |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
284 return _(b'good (implicit)') |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
285 if rev in get(repo, b'bads'): |
15308
ab341fbb05b1
bisect: add i18n contexts
Wagner Bruna <wbruna@softwareexpress.com.br>
parents:
15154
diff
changeset
|
286 # i18n: bisect changeset status |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
287 return _(b'bad (implicit)') |
15154
aa2e908c521e
hbisect: add functions to return a label for a cset bisection status
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15153
diff
changeset
|
288 |
aa2e908c521e
hbisect: add functions to return a label for a cset bisection status
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15153
diff
changeset
|
289 return None |
aa2e908c521e
hbisect: add functions to return a label for a cset bisection status
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parents:
15153
diff
changeset
|
290 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
291 |
30067
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
292 def printresult(ui, repo, state, displayer, nodes, good): |
42310
21eda240be07
bisect: do not crash with rewritten commits
timeless <timeless@mozdev.org>
parents:
42057
diff
changeset
|
293 repo = repo.unfiltered() |
30067
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
294 if len(nodes) == 1: |
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
295 # narrowed it down to a single revision |
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
296 if good: |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
297 ui.write(_(b"The first good revision is:\n")) |
30067
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
298 else: |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
299 ui.write(_(b"The first bad revision is:\n")) |
30067
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
300 displayer.show(repo[nodes[0]]) |
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
301 extendnode = extendrange(repo, state, nodes, good) |
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
302 if extendnode is not None: |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
303 ui.write( |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
304 _( |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
305 b'Not all ancestors of this changeset have been' |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
306 b' checked.\nUse bisect --extend to continue the ' |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
307 b'bisection from\nthe common ancestor, %s.\n' |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
308 ) |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
309 % extendnode |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
310 ) |
30067
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
311 else: |
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
312 # multiple possible revisions |
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
313 if good: |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
314 ui.write( |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
315 _( |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
316 b"Due to skipped revisions, the first " |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
317 b"good revision could be any of:\n" |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
318 ) |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
319 ) |
30067
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
320 else: |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
321 ui.write( |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
322 _( |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
323 b"Due to skipped revisions, the first " |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
324 b"bad revision could be any of:\n" |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
325 ) |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42310
diff
changeset
|
326 ) |
30067
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
327 for n in nodes: |
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
328 displayer.show(repo[n]) |
6e88cd060ba2
bisect: move 'printresult' in the 'hbisect' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30066
diff
changeset
|
329 displayer.close() |