svn_binary_seach
0.01
svn_binary_search -r rev:rev -c test_script [-n test_name] [-d outdir] [-q]
Need to know when a feature was added to a project in your svn repository? When a regression test started failing? Write up a small script that tests your feature or failure, feed in a begin/end revision, and this script will run a binary search through those svn revisions in a checked-out working copy determine which revision changed the behavior.
Required. Specify a colon separated pair of revision numbers that inclusively bound your search.
Required. Executable that will generate output to test your condition on various svn revisions of your project. EXAMPLES.
Optional. Override the default file name (revision_) for generated files
Optional. Override the default temp directory for generated files.
Optional. Run quietly, surpressing output from svn up commands.
Before you begin, you must have a working copy of your repository checked out locally. svn must be in your path. It is recommended that you have a pristine copy checked out, with no local modifications.
svn
The most important part of this tool is the test script that you provide. The script must generate all output to be compared to STDOUT. Any information sent to STDERR will be preserved in a log so you can further track down any build issues, etc.
STDOUT
STDERR
A sample (sh) test script:
make clean 1>&2 sh configure 1>&2 make 1>&2 prove t/some_test.t 1>&2 echo $?
Note that all but the last step redirect all their output to STDERR, including the run of the test itself: The only result that we care about is whether the test passed or not. While it would be tempting to just dump the output from prove and compare it, prove generates timing information which might change from run to run. The entirety of the text sent to STDOUT is used to compare the results, so construct your test carefully.
prove
You can then run this with:
svn_binary_search -r 920:967 -c your_script
As it runs, you'll see the output from the svn up commands, followed by, e.g:
svn up
*** changed between r951 and r952
As it runs, output will be placed in a temporary directory (overridable on the command line with -d). Output will end up in files like:
-d
revision_920.log revision_920.out
Where the test name (which defaults to "revision", but can be overriden by the -n option) and the svn version number form the base name, and the extension is either .log (from STDERR) or .out (from STDOUT).
-n
.log
.out
Will Coleda, <coke at cpan.org>
To install App::SVNBinarySearch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::SVNBinarySearch
CPAN shell
perl -MCPAN -e shell install App::SVNBinarySearch
For more information on module installation, please visit the detailed CPAN module installation guide.