bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
0.54.1
by Jeff Licquia
Initial revision. The plugin skeleton is made, along with a spec for |
1 |
from bzrlib.commands import Command, register_command |
|
0.54.2
by Jeff Licquia
Set up the subcommand dispatcher. |
2 |
from errors import CommandError |
|
0.54.1
by Jeff Licquia
Initial revision. The plugin skeleton is made, along with a spec for |
3 |
|
4 |
class cmd_bisect(Command): |
|
5 |
"""Find an interesting commit using a binary search. |
|
6 |
||
7 |
Bisecting, in a nutshell, is a way to find the commit at which
|
|
8 |
some testable change was made, such as the introduction of a bug
|
|
9 |
or feature. By identifying a version which did not have the
|
|
10 |
interesting change and a later version which did, a developer
|
|
11 |
can test for the presence of the change at various points in
|
|
12 |
the history, eventually ending up at the precise commit when
|
|
13 |
the change was first introduced.
|
|
14 |
||
15 |
This command uses subcommands to implement the search, each
|
|
16 |
of which changes the state of the bisection. The
|
|
17 |
subcommands are:
|
|
18 |
||
19 |
bzr bisect start
|
|
20 |
Start a bisect, possibly clearing out a previous bisect.
|
|
21 |
||
22 |
bzr bisect yes [-r rev]
|
|
23 |
The specified revision (or the current revision, if not given)
|
|
24 |
has the characteristic we're looking for,
|
|
25 |
||
26 |
bzr bisect no [-r rev]
|
|
27 |
The specified revision (or the current revision, if not given)
|
|
28 |
does not have the charactistic we're looking for,
|
|
29 |
||
30 |
bzr bisect reset
|
|
31 |
Clear out a bisection in progress.
|
|
32 |
||
33 |
bzr bisect log
|
|
34 |
Output a log of the current bisection to standard output.
|
|
35 |
||
36 |
bzr bisect replay <logfile>
|
|
37 |
Replay a previously-saved bisect log, forgetting any bisection
|
|
38 |
that might be in progress.
|
|
|
0.54.2
by Jeff Licquia
Set up the subcommand dispatcher. |
39 |
"""
|
40 |
||
41 |
takes_args = ['subcommand', 'args*'] |
|
42 |
||
43 |
def run(self, subcommand, args_list): |
|
44 |
# Handle subcommand parameters.
|
|
45 |
||
46 |
revision = None |
|
47 |
log_fn = None |
|
48 |
if subcommand in ('yes', 'no') and len(args_list) == 2: |
|
49 |
if args_list[0] == "-r": |
|
50 |
revision = args_list[1] |
|
51 |
else: |
|
52 |
raise CommandError("Improper arguments to bisect " + subcommand) |
|
53 |
elif subcommand in ('replay',) and len(args_list) == 1: |
|
54 |
log_fn = args_list[0] |
|
55 |
elif args_list: |
|
56 |
raise CommandError("Improper arguments to bisect " + subcommand) |
|
57 |
||
58 |
# Dispatch.
|
|
59 |
||
60 |
if subcommand == "start": |
|
61 |
self.start() |
|
62 |
elif subcommand == "yes": |
|
63 |
self.yes(revision) |
|
64 |
elif subcommand == "no": |
|
65 |
self.no(revision) |
|
66 |
elif subcommand == "reset": |
|
67 |
self.reset() |
|
68 |
elif subcommand == "log": |
|
69 |
self.log(None) |
|
70 |
elif subcommand == "replay": |
|
71 |
self.replay(log_fn) |
|
72 |
||
73 |
def reset(self): |
|
74 |
"Reset the bisect state to no state."
|
|
75 |
pass
|
|
76 |
||
77 |
def start(self): |
|
78 |
"Reset the bisect state, then prepare for a new bisection."
|
|
79 |
pass
|
|
80 |
||
81 |
def yes(self, revision): |
|
82 |
"Mark that a given revision has the state we're looking for."
|
|
83 |
pass
|
|
84 |
||
85 |
def no(self, revision): |
|
86 |
"Mark that a given revision does not have the state we're looking for."
|
|
87 |
pass
|
|
88 |
||
89 |
def log(self, filename): |
|
90 |
"Write the current bisect log to a file."
|
|
91 |
pass
|
|
92 |
||
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."""
|
|
96 |
pass
|
|
|
0.54.1
by Jeff Licquia
Initial revision. The plugin skeleton is made, along with a spec for |
97 |
|
98 |
register_command(cmd_bisect) |