App-KGB
view release on metacpan or search on metacpan
eg/kgb-client.conf.sample view on Meta::CPAN
---
# repo-id is mandatory
repo-id: foo
# optional list of regular expressions for matching branch and module name each
# entry is matched against the changed path, $1 is supposed to be the branch
# name, $2 - the module (package) name
# forward slashes are escaped, so no special treatment is needed here
# the sample is taken from pkg-perl SVN repository, which is Layout 2 (all
# trunks under trunk/ and has a special place for applications and
# almost-removed stuff)
branch-and-module-re:
- "/(trunk|tags|apps|attic)/([^/]+)"
- "/branches/([^/]+)/([^/]+)"
# for layout 1 package -> trunk/branches/tags) naturally the package name comes
# into $1 and the branch - into $2. To remedy the situation, use the other
# variant:
# module-and-branch-re:
lib/App/KGB/Client.pm view on Meta::CPAN
and module.
( $branch, $module ) = $client->detect_branch_and_module($changes);
=cut
sub _run_matches {
my ( $safe, $changes, $res, $swap ) = @_;
for my $re (@$res) {
$re =~ s{,}{\\,}g; # escape commas
my $matching = "m,$re,; " . ( $swap ? '($2,$1)' : '($1,$2)' );
local $_ = $changes->path;
my ( $branch, $module ) = $safe->reval($matching);
die "Error while evaluating `$re': $@" if $@;
if ( defined($branch) and defined($module) ) {
return ( $re, $branch, $module );
}
}
( run in 0.891 second using v1.01-cache-2.11-cpan-c21f80fb71c )