1App::SVN::Bisect(3) User Contributed Perl Documentation App::SVN::Bisect(3)
2
3
4
6 App::SVN::Bisect - binary search through svn revisions
7
9 my $bisect = App::SVN::Bisect->new(
10 Action => $action,
11 Min => $min,
12 Max => $max
13 );
14 $bisect->do_something_intelligent(@ARGV);
15
17 This module implements the backend of the "svn-bisect" command line
18 tool. See the POD documentation of that tool, for usage details.
19
21 new
22 $self = App::SVN::Bisect->new(Action => "bad", Min => 0, Max => undef);
23
24 Create an App::SVN::Bisect object. The arguments are typically parsed
25 from the command line.
26
27 The Action argument must be listed in the %actions table. The
28 "read_config" attribute of the action determines whether the metadata
29 file (typically named .svn/bisect.yaml) will be read.
30
31 do_something_intelligent
32 $self->do_something_intelligent(@ARGV);
33
34 Executes the action specified by the user. See the "Action methods"
35 section, below, for the details.
36
37 If the action's "write_config" bit is set in the %actions table, the
38 metadata file will be written after executing the action. If the bit
39 was not set, the metadata file is removed.
40
42 start
43 Begins a bisect session. Sets up the parameters, queries some stuff
44 about the subversion repository, and starts the user off with the first
45 bisect.
46
47 before
48 Sets the "min" parameter to the specified (or current) revision, and
49 then moves the user to the middle of the resulting range.
50
51 after
52 Sets the "max" parameter to the specified (or current) revision, and
53 then moves the user to the middle of the resulting range.
54
55 reset
56 Cleans up after a bisect session. If --back is passed, it also moves
57 the working tree back to the original revision it had when "start" was
58 first called.
59
60 skip
61 Tells svn-bisect to ignore the specified (or current) revision, and
62 then moves the user to another, strategically useful revision.
63
64 You may specify as many revisions at once as you like.
65
66 unskip
67 Tells svn-bisect to stop ignoring the specified revision, then moves
68 the user to another, strategically useful revision.
69
70 You may specify as many revisions at once as you like.
71
72 run
73 Runs a command repeatedly to automate the bisection process.
74
75 We run the command and arguments until a conclusion is reached. The
76 command (usually a shell script) tells us about the current revision by
77 way of its return code. The following return codes are handled:
78
79 0: This revision is before the change we're looking for
80 1-124, 126-127: This revision includes the change we're looking for
81 125: This revision is untestable and should be skipped
82 any other value: The command failed to run, abort bisection.
83
84 The normal caveats apply. In particular, if your script makes any
85 changes, don't forget to clean up afterwards.
86
87 help
88 Allows the user to get some descriptions and usage information.
89
90 This function calls exit() directly, to prevent
91 do_something_intelligent() from removing the metadata file.
92
93 view
94 Allows the user to get some information about the current state of
95 things.
96
97 This function calls exit() directly, to prevent
98 do_something_intelligent() from removing the metadata file.
99
101 cmd
102 my $stdout = $self->cmd("svn info");
103
104 Runs a command, returns its output.
105
106 ready
107 $self->next_rev() if $self->ready();
108
109 Returns a true value if we have enough information to begin bisecting.
110 Specifically, this returns true if we have been given at least one
111 "bad" and one "good" revision. These can be specified as arguments to
112 the "before" and "after" commands, or as --min and --max arguments to
113 the "start" command.
114
115 next_rev
116 $self->next_rev();
117
118 Find a spot in the middle of the current "suspect revisions" list, and
119 calls "svn update" to move the checkout directory to that revision.
120
121 list_revs
122 my @revs = $self->list_revs();
123
124 Returns the set of valid revisions between the current "min" and "max"
125 values, exclusive.
126
127 This is smart about revisions that don't affect the current tree
128 (because they won't be returned by fetch_log_revs, below) and about
129 skipped revisions (which the user may specify with the "skip" command).
130
131 stdout
132 $self->stdout("Hello, world!\n");
133
134 Output a message to stdout. This is basically just the "print"
135 function, but we use a method so the testsuite can override it through
136 subclassing.
137
138 verbose
139 $self->verbose("Hello, world!\n");
140
141 Output a message to stdout, if the user specified the --verbose option.
142 This is basically just a conditional wrapper around the "print"
143 function.
144
145 exit
146 $self->exit(0);
147
148 Exits. This allows the test suite to override exiting; it does not
149 provide any other features above and beyond what the normal exit system
150 call provides.
151
153 update_to
154 $self->update_to(25000);
155
156 Calls 'svn update' to move to the specified revision.
157
158 fetch_log_revs
159 my $hashref = $self->fetch_log_revs();
160
161 Calls "svn log" and parses the output. Returns a hash reference whose
162 keys are valid revision numbers; so you can use exists() to find out
163 whether a number is in the list. This hash reference is used by
164 list_revs(), above.
165
166 find_max
167 my $rev = $self->find_max();
168
169 Plays some tricks with "svn log" to figure out the latest revision
170 contained within the repository.
171
172 find_cur
173 my $rev = $self->find_cur();
174
175 Parses the output of "svn info" to figure out what the current revision
176 is.
177
179 Mark Glines <mark-cpan@glines.org>
180
182 * Thanks to the git-bisect author(s), for coming up with a user
183 interface that I actually like.
184
185 * Thanks to Will Coleda for inspiring me to actually write and release
186 this.
187
188 * Thanks to the Parrot project for having so much random stuff going on
189 as to make a tool like this necessary.
190
192 App::SVNBinarySearch by Will Coleda:
193 <http://search.cpan.org/dist/App-SVNBinarySearch/>
194
196 This software is copyright (c) 2008-2009 Mark Glines.
197
198 It is distributed under the terms of the Artistic License 2.0. For
199 details, see the "LICENSE" file packaged alongside this module.
200
201
202
203perl v5.30.1 2020-01-29 App::SVN::Bisect(3)