NAME

App::SVN::Bisect

SYNOPSIS

my $bisect = App::SVN::Bisect->new(
    Action => $action,
    Min => $min,
    Max => $max
);
$bisect->do_something_intelligent(@ARGV);

DESCRIPTION

This module implements the backend of the "svn-bisect" command line tool. See the POD documentation of that tool, for usage details.

API methods

new

$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.

do_something_intelligent

$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.

Action methods

start

Begins a bisect session. Sets up the parameters, queries some stuff about the subversion repository, and starts the user off with the first bisect.

before

Sets the "min" parameter to the current revision, and then moves the user to the middle of the resulting range.

after

Sets the "max" parameter to the current revision, and then moves the user to the middle of the resulting range.

reset

Cleans up after a bisect session; moves the user back to the revision they had when "start" was first called.

skip

Tells svn-bisect to ignore the current revision, and then moves the user to another, nearby revision.

help

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.

Internal methods

run

my $stdout = $self->run("svn info");

Runs a command, returns its output.

next_rev

$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.

list_revs

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).

Subversion accessor methods

update_to

$self->update_to(25000);

Calls 'svn update' to move to the specified revision.

fetch_log_revs

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.

find_max

my $rev = $self->find_max();

Plays some tricks with "svn log" to figure out the latest revision contained within the repository.

find_cur

my $rev = $self->find_cur();

Parses the output of "svn info" to figure out what the current revision is.

AUTHOR

Mark Glines <mark-cpan@glines.org>

THANKS

* 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.

COPYRIGHT AND LICENSE

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.

1;