##// END OF EJS Templates
hbisect: add two new revset descriptions: 'goods' and 'bads'...
"Yann E. MORIN" -
r15153:fa0a464e default
parent child Browse files
Show More
@@ -158,9 +158,10 b' def get(repo, status):'
158 158 """
159 159 Return a list of revision(s) that match the given status:
160 160
161 - ``good``, ``bad``, ``skip``: as the names imply
162 - ``range`` : all csets taking part in the bisection
163 - ``pruned`` : csets that are good, bad or skipped
161 - ``good``, ``bad``, ``skip``: csets explicitly marked as good/bad/skip
162 - ``goods``, ``bads`` : csets topologicaly good/bad
163 - ``range`` : csets taking part in the bisection
164 - ``pruned`` : csets that are goods, bads or skipped
164 165 - ``untested`` : csets whose fate is yet unknown
165 166 - ``ignored`` : csets ignored due to DAG topology
166 167 """
@@ -178,16 +179,20 b' def get(repo, status):'
178 179 # that's because the bisection can go either way
179 180 range = '( bisect(bad)::bisect(good) | bisect(good)::bisect(bad) )'
180 181
181 # 'pruned' is all csets whose fate is already known:
182 # - a good ancestor and a good ascendant, or
183 # - a bad ancestor and a bad descendant, or
184 # - skipped
185 # But in case of irrelevant goods/bads, we also need to
186 # include them.
187 pg = 'bisect(good)::bisect(good)' # Pruned goods
188 pb = 'bisect(bad)::bisect(bad)' # Pruned bads
189 ps = 'bisect(skip)' # Pruned skipped
190 pruned = '( (%s) | (%s) | (%s) )' % (pg, pb, ps)
182 _t = [c.rev() for c in repo.set('bisect(good)::bisect(bad)')]
183 # The sets of topologically good or bad csets
184 if len(_t) == 0:
185 # Goods are topologically after bads
186 goods = 'bisect(good)::' # Pruned good csets
187 bads = '::bisect(bad)' # Pruned bad csets
188 else:
189 # Goods are topologically before bads
190 goods = '::bisect(good)' # Pruned good csets
191 bads = 'bisect(bad)::' # Pruned bad csets
192
193 # 'pruned' is all csets whose fate is already known: good, bad, skip
194 skips = 'bisect(skip)' # Pruned skipped csets
195 pruned = '( (%s) | (%s) | (%s) )' % (goods, bads, skips)
191 196
192 197 # 'untested' is all cset that are- in 'range', but not in 'pruned'
193 198 untested = '( (%s) - (%s) )' % (range, pruned)
@@ -208,6 +213,10 b' def get(repo, status):'
208 213 return [c.rev() for c in repo.set(untested)]
209 214 elif status == 'ignored':
210 215 return [c.rev() for c in repo.set(ignored)]
216 elif status == "goods":
217 return [c.rev() for c in repo.set(goods)]
218 elif status == "bads":
219 return [c.rev() for c in repo.set(bads)]
211 220
212 221 else:
213 222 raise error.ParseError(_('invalid bisect state'))
@@ -237,13 +237,14 b' def author(repo, subset, x):'
237 237
238 238 def bisect(repo, subset, x):
239 239 """``bisect(string)``
240 Changesets marked in the specified bisect status (``good``, ``bad``,
241 ``skip``), or any of the meta-status:
240 Changesets marked in the specified bisect status:
242 241
243 - ``range`` : all csets taking part in the bisection
244 - ``pruned`` : csets that are good, bad or skipped
245 - ``untested`` : csets whose fate is yet unknown
246 - ``ignored`` : csets ignored due to DAG topology
242 - ``good``, ``bad``, ``skip``: csets explicitly marked as good/bad/skip
243 - ``goods``, ``bads`` : csets topologicaly good/bad
244 - ``range`` : csets taking part in the bisection
245 - ``pruned`` : csets that are goods, bads or skipped
246 - ``untested`` : csets whose fate is yet unknown
247 - ``ignored`` : csets ignored due to DAG topology
247 248 """
248 249 status = getstring(x, _("bisect requires a string")).lower()
249 250 return [r for r in subset if r in hbisect.get(repo, status)]
@@ -322,9 +322,26 b' complex bisect test 1 # first bad rev i'
322 322 15:857b178a7cf3
323 323 16:609d82a7ebae
324 324 17:228c06deef46
325 18:d42e18c7bc9b
325 326 $ hg log -q -r 'bisect(untested)'
326 327 11:82ca6f06eccd
327 328 12:9f259202bbe7
329 $ hg log -q -r 'bisect(goods)'
330 0:33b1f9bc8bc5
331 1:4ca5088da217
332 2:051e12f87bf1
333 3:0950834f0a9c
334 4:5c668c22234f
335 5:385a529b6670
336 6:a214d5d3811a
337 8:dab8161ac8fc
338 $ hg log -q -r 'bisect(bads)'
339 9:3c77083deb4a
340 10:429fcd26f52d
341 15:857b178a7cf3
342 16:609d82a7ebae
343 17:228c06deef46
344 18:d42e18c7bc9b
328 345
329 346 complex bisect test 2 # first good rev is 13
330 347
@@ -337,6 +354,7 b' complex bisect test 2 # first good rev '
337 354 Testing changeset 10:429fcd26f52d (13 changesets remaining, ~3 tests)
338 355 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
339 356 $ hg log -q -r 'bisect(pruned)'
357 0:33b1f9bc8bc5
340 358 1:4ca5088da217
341 359 6:a214d5d3811a
342 360 18:d42e18c7bc9b
@@ -344,6 +362,7 b' complex bisect test 2 # first good rev '
344 362 Testing changeset 12:9f259202bbe7 (5 changesets remaining, ~2 tests)
345 363 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
346 364 $ hg log -q -r 'bisect(pruned)'
365 0:33b1f9bc8bc5
347 366 1:4ca5088da217
348 367 2:051e12f87bf1
349 368 3:0950834f0a9c
@@ -396,8 +415,10 b' 10,9,13 are skipped an might be the firs'
396 415 Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests)
397 416 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
398 417 $ hg log -q -r 'bisect(pruned)'
418 0:33b1f9bc8bc5
399 419 1:4ca5088da217
400 420 16:609d82a7ebae
421 17:228c06deef46
401 422 $ hg bisect -g # -> update to rev 13
402 423 Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests)
403 424 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -408,6 +429,7 b' 10,9,13 are skipped an might be the firs'
408 429 Testing changeset 12:9f259202bbe7 (8 changesets remaining, ~3 tests)
409 430 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
410 431 $ hg log -q -r 'bisect(pruned)'
432 0:33b1f9bc8bc5
411 433 1:4ca5088da217
412 434 2:051e12f87bf1
413 435 3:0950834f0a9c
@@ -417,6 +439,7 b' 10,9,13 are skipped an might be the firs'
417 439 10:429fcd26f52d
418 440 13:b0a32c86eb31
419 441 16:609d82a7ebae
442 17:228c06deef46
420 443 $ hg bisect -g # -> update to rev 9
421 444 Testing changeset 9:3c77083deb4a (5 changesets remaining, ~2 tests)
422 445 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -484,6 +507,13 b' 15,16 are skipped an might be the first '
484 507 Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests)
485 508 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
486 509 $ hg log -q -r 'bisect(pruned)'
510 0:33b1f9bc8bc5
511 1:4ca5088da217
512 2:051e12f87bf1
513 3:0950834f0a9c
514 4:5c668c22234f
515 5:385a529b6670
516 6:a214d5d3811a
487 517 8:dab8161ac8fc
488 518 9:3c77083deb4a
489 519 10:429fcd26f52d
@@ -495,6 +525,13 b' 15,16 are skipped an might be the first '
495 525 Testing changeset 16:609d82a7ebae (3 changesets remaining, ~1 tests)
496 526 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
497 527 $ hg log -q -r 'bisect(pruned)'
528 0:33b1f9bc8bc5
529 1:4ca5088da217
530 2:051e12f87bf1
531 3:0950834f0a9c
532 4:5c668c22234f
533 5:385a529b6670
534 6:a214d5d3811a
498 535 8:dab8161ac8fc
499 536 9:3c77083deb4a
500 537 10:429fcd26f52d
@@ -533,6 +570,13 b' 15,16 are skipped an might be the first '
533 570 16:609d82a7ebae
534 571 17:228c06deef46
535 572 $ hg log -q -r 'bisect(pruned)'
573 0:33b1f9bc8bc5
574 1:4ca5088da217
575 2:051e12f87bf1
576 3:0950834f0a9c
577 4:5c668c22234f
578 5:385a529b6670
579 6:a214d5d3811a
536 580 8:dab8161ac8fc
537 581 9:3c77083deb4a
538 582 10:429fcd26f52d
@@ -552,6 +596,11 b' test unrelated revs:'
552 596 [255]
553 597 $ hg log -q -r 'bisect(range)'
554 598 $ hg log -q -r 'bisect(pruned)'
599 0:33b1f9bc8bc5
600 1:4ca5088da217
601 2:051e12f87bf1
602 3:0950834f0a9c
603 4:5c668c22234f
555 604 7:50c76098bbf2
556 605 14:faa450606157
557 606 $ hg bisect --reset
@@ -594,12 +643,16 b' end at merge: 17 bad, 11 good (but 9 is '
594 643 16:609d82a7ebae
595 644 17:228c06deef46
596 645 $ hg log -q -r 'bisect(pruned)'
646 0:33b1f9bc8bc5
647 1:4ca5088da217
648 8:dab8161ac8fc
597 649 11:82ca6f06eccd
598 650 12:9f259202bbe7
599 651 13:b0a32c86eb31
600 652 15:857b178a7cf3
601 653 16:609d82a7ebae
602 654 17:228c06deef46
655 18:d42e18c7bc9b
603 656 $ hg log -q -r 'bisect(untested)'
604 657 $ hg log -q -r 'bisect(ignored)'
605 658 2:051e12f87bf1
@@ -633,6 +686,18 b' end at merge: 17 bad, 11 good (but 9 is '
633 686 4:5c668c22234f
634 687 5:385a529b6670
635 688 6:a214d5d3811a
689 $ hg log -q -r 'bisect(goods)'
690 0:33b1f9bc8bc5
691 1:4ca5088da217
692 8:dab8161ac8fc
693 11:82ca6f06eccd
694 12:9f259202bbe7
695 13:b0a32c86eb31
696 $ hg log -q -r 'bisect(bads)'
697 15:857b178a7cf3
698 16:609d82a7ebae
699 17:228c06deef46
700 18:d42e18c7bc9b
636 701 $ hg bisect -b
637 702 The first bad revision is:
638 703 changeset: 9:3c77083deb4a
@@ -651,6 +716,8 b' end at merge: 17 bad, 11 good (but 9 is '
651 716 16:609d82a7ebae
652 717 17:228c06deef46
653 718 $ hg log -q -r 'bisect(pruned)'
719 0:33b1f9bc8bc5
720 1:4ca5088da217
654 721 8:dab8161ac8fc
655 722 9:3c77083deb4a
656 723 10:429fcd26f52d
@@ -660,6 +727,7 b' end at merge: 17 bad, 11 good (but 9 is '
660 727 15:857b178a7cf3
661 728 16:609d82a7ebae
662 729 17:228c06deef46
730 18:d42e18c7bc9b
663 731 $ hg log -q -r 'bisect(untested)'
664 732 $ hg log -q -r 'bisect(ignored)'
665 733 2:051e12f87bf1
@@ -667,6 +735,20 b' end at merge: 17 bad, 11 good (but 9 is '
667 735 4:5c668c22234f
668 736 5:385a529b6670
669 737 6:a214d5d3811a
738 $ hg log -q -r 'bisect(goods)'
739 0:33b1f9bc8bc5
740 1:4ca5088da217
741 8:dab8161ac8fc
742 11:82ca6f06eccd
743 12:9f259202bbe7
744 13:b0a32c86eb31
745 $ hg log -q -r 'bisect(bads)'
746 9:3c77083deb4a
747 10:429fcd26f52d
748 15:857b178a7cf3
749 16:609d82a7ebae
750 17:228c06deef46
751 18:d42e18c7bc9b
670 752
671 753 user adds irrelevant but consistent information (here: -g 2) to bisect state
672 754
@@ -698,9 +780,16 b' user adds irrelevant but consistent info'
698 780 12:9f259202bbe7
699 781 13:b0a32c86eb31
700 782 $ hg log -q -r 'bisect(pruned)'
783 0:33b1f9bc8bc5
784 1:4ca5088da217
701 785 2:051e12f87bf1
702 786 8:dab8161ac8fc
703 787 11:82ca6f06eccd
704 788 12:9f259202bbe7
705 789 13:b0a32c86eb31
790 14:faa450606157
791 15:857b178a7cf3
792 16:609d82a7ebae
793 17:228c06deef46
794 18:d42e18c7bc9b
706 795 $ hg log -q -r 'bisect(untested)'
General Comments 0
You need to be logged in to leave comments. Login now