App::SVN::Bisect - binary search through svn revisions
my $bisect = App::SVN::Bisect->new( Action => $action, Min => $min, Max => $max ); $bisect->do_something_intelligent(@ARGV);
This module implements the backend of the "svn-bisect" command line tool. See the POD documentation of that tool, for usage details.
$self = App::SVN::Bisect->new(Action => "bad", Min => 0, Max => undef);
Create an App::SVN::Bisect object. The arguments are typically parsed from the command line.
The Action argument must be listed in the %actions table. The "read_config" attribute of the action determines whether the metadata file (typically named .svn/bisect.yaml) will be read.
$self->do_something_intelligent(@ARGV);
Executes the action specified by the user. See the "Action methods" section, below, for the details.
If the action's "write_config" bit is set in the %actions table, the metadata file will be written after executing the action. If the bit was not set, the metadata file is removed.
Begins a bisect session. Sets up the parameters, queries some stuff about the subversion repository, and starts the user off with the first bisect.
Sets the "min" parameter to the current revision, and then moves the user to the middle of the resulting range.
Sets the "max" parameter to the current revision, and then moves the user to the middle of the resulting range.
Cleans up after a bisect session; moves the user back to the revision they had when "start" was first called.
Tells svn-bisect to ignore the current revision, and then moves the user to another, nearby revision.
Allows the user to get some descriptions and usage information.
This function calls exit() directly, to prevent do_something_intelligent() from removing the metadata file.
my $stdout = $self->run("svn info");
Runs a command, returns its output.
$self->next_rev();
Find a spot in the middle of the current "suspect revisions" list, and calls "svn update" to move the checkout directory to that revision.
my @revs = $self->list_revs();
Returns the set of valid revisions between the current "min" and "max" values, exclusive.
This is smart about revisions that don't affect the current tree (because they won't be returned by fetch_log_revs, below) and about skipped revisions (which the user may specify with the "skip" command).
$self->stdout("Hello, world!\n");
Output a message to stdout. This is basically just the "print" function, but we use a method so the testsuite can override it through subclassing.
$self->verbose("Hello, world!\n");
Output a message to stdout, if the user specified the --verbose option. This is basically just a conditional wrapper around the "print" function.
$self->update_to(25000);
Calls 'svn update' to move to the specified revision.
my $hashref = $self->fetch_log_revs();
Calls "svn log" and parses the output. Returns a hash reference whose keys are valid revision numbers; so you can use exists() to find out whether a number is in the list. This hash reference is used by list_revs(), above.
my $rev = $self->find_max();
Plays some tricks with "svn log" to figure out the latest revision contained within the repository.
my $rev = $self->find_cur();
Parses the output of "svn info" to figure out what the current revision is.
Mark Glines <mark-cpan@glines.org>
* Thanks to the git-bisect author(s), for coming up with a user interface that I actually like.
* Thanks to Will Coleda for inspiring me to actually write and release this.
* Thanks to the Parrot project for having so much random stuff going on as to make a tool like this necessary.
This software is copyright (c) 2008 Mark Glines.
It is distributed under the terms of the Artistic License 2.0. For details, see the "LICENSE" file packaged alongside this module.
To install App::SVN::Bisect, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::SVN::Bisect
CPAN shell
perl -MCPAN -e shell install App::SVN::Bisect
For more information on module installation, please visit the detailed CPAN module installation guide.