Show More
@@ -6,7 +6,7 b'' | |||||
6 | # GNU General Public License version 2 or any later version. |
|
6 | # GNU General Public License version 2 or any later version. | |
7 |
|
7 | |||
8 | import re |
|
8 | import re | |
9 | import parser, util, error, discovery, help |
|
9 | import parser, util, error, discovery, help, hbisect | |
10 | import bookmarks as bookmarksmod |
|
10 | import bookmarks as bookmarksmod | |
11 | import match as matchmod |
|
11 | import match as matchmod | |
12 | from i18n import _ |
|
12 | from i18n import _ | |
@@ -683,12 +683,27 b' def bookmark(repo, subset, x):' | |||||
683 | for r in bookmarksmod.listbookmarks(repo).values()]) |
|
683 | for r in bookmarksmod.listbookmarks(repo).values()]) | |
684 | return [r for r in subset if r in bms] |
|
684 | return [r for r in subset if r in bms] | |
685 |
|
685 | |||
|
686 | def bisected(repo, subset, x): | |||
|
687 | """``bisected(string)`` | |||
|
688 | Changesets marked in the specified bisect state (good, bad, skip). | |||
|
689 | """ | |||
|
690 | state = getstring(x, _("bisect requires a string")).lower() | |||
|
691 | if state not in ('good', 'bad', 'skip', 'unknown'): | |||
|
692 | raise ParseError(_('invalid bisect state')) | |||
|
693 | marked = set(repo.changelog.rev(n) for n in hbisect.load_state(repo)[state]) | |||
|
694 | l = [] | |||
|
695 | for r in subset: | |||
|
696 | if r in marked: | |||
|
697 | l.append(r) | |||
|
698 | return l | |||
|
699 | ||||
686 | symbols = { |
|
700 | symbols = { | |
687 | "adds": adds, |
|
701 | "adds": adds, | |
688 | "all": getall, |
|
702 | "all": getall, | |
689 | "ancestor": ancestor, |
|
703 | "ancestor": ancestor, | |
690 | "ancestors": ancestors, |
|
704 | "ancestors": ancestors, | |
691 | "author": author, |
|
705 | "author": author, | |
|
706 | "bisected": bisected, | |||
692 | "bookmark": bookmark, |
|
707 | "bookmark": bookmark, | |
693 | "branch": branch, |
|
708 | "branch": branch, | |
694 | "children": children, |
|
709 | "children": children, |
@@ -377,6 +377,44 b' reproduce AssertionError, issue1445' | |||||
377 | date: Thu Jan 01 00:00:06 1970 +0000 |
|
377 | date: Thu Jan 01 00:00:06 1970 +0000 | |
378 | summary: msg 6 |
|
378 | summary: msg 6 | |
379 |
|
379 | |||
|
380 | $ hg log -r "bisected(good)" | |||
|
381 | changeset: 0:b99c7b9c8e11 | |||
|
382 | user: test | |||
|
383 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
384 | summary: msg 0 | |||
|
385 | ||||
|
386 | changeset: 5:7874a09ea728 | |||
|
387 | user: test | |||
|
388 | date: Thu Jan 01 00:00:05 1970 +0000 | |||
|
389 | summary: msg 5 | |||
|
390 | ||||
|
391 | $ hg log -r "bisected(bad)" | |||
|
392 | changeset: 6:a3d5c6fdf0d3 | |||
|
393 | user: test | |||
|
394 | date: Thu Jan 01 00:00:06 1970 +0000 | |||
|
395 | summary: msg 6 | |||
|
396 | ||||
|
397 | $ hg log -r "bisected(skip)" | |||
|
398 | changeset: 1:5cd978ea5149 | |||
|
399 | user: test | |||
|
400 | date: Thu Jan 01 00:00:01 1970 +0000 | |||
|
401 | summary: msg 1 | |||
|
402 | ||||
|
403 | changeset: 2:db07c04beaca | |||
|
404 | user: test | |||
|
405 | date: Thu Jan 01 00:00:02 1970 +0000 | |||
|
406 | summary: msg 2 | |||
|
407 | ||||
|
408 | changeset: 3:b53bea5e2fcb | |||
|
409 | user: test | |||
|
410 | date: Thu Jan 01 00:00:03 1970 +0000 | |||
|
411 | summary: msg 3 | |||
|
412 | ||||
|
413 | changeset: 4:9b2ba8336a65 | |||
|
414 | user: test | |||
|
415 | date: Thu Jan 01 00:00:04 1970 +0000 | |||
|
416 | summary: msg 4 | |||
|
417 | ||||
380 |
|
418 | |||
381 | $ set +e |
|
419 | $ set +e | |
382 |
|
420 |
General Comments 0
You need to be logged in to leave comments.
Login now