1
1
from bzrlib.commands import Command, register_command
2
from errors import CommandError
3
4
class cmd_bisect(Command):
4
5
"""Find an interesting commit using a binary search.
35
36
bzr bisect replay <logfile>
36
37
Replay a previously-saved bisect log, forgetting any bisection
37
38
that might be in progress.
41
takes_args = ['subcommand', 'args*']
43
def run(self, subcommand, args_list):
44
# Handle subcommand parameters.
48
if subcommand in ('yes', 'no') and len(args_list) == 2:
49
if args_list[0] == "-r":
50
revision = args_list[1]
52
raise CommandError("Improper arguments to bisect " + subcommand)
53
elif subcommand in ('replay',) and len(args_list) == 1:
56
raise CommandError("Improper arguments to bisect " + subcommand)
60
if subcommand == "start":
62
elif subcommand == "yes":
64
elif subcommand == "no":
66
elif subcommand == "reset":
68
elif subcommand == "log":
70
elif subcommand == "replay":
74
"Reset the bisect state to no state."
78
"Reset the bisect state, then prepare for a new bisection."
81
def yes(self, revision):
82
"Mark that a given revision has the state we're looking for."
85
def no(self, revision):
86
"Mark that a given revision does not have the state we're looking for."
89
def log(self, filename):
90
"Write the current bisect log to a file."
93
def replay(self, filename):
94
"""Apply the given log file to a clean state, so the state is
95
exactly as it was when the log was saved."""
40
98
register_command(cmd_bisect)