help => 0,
man => 0,
verbose => 0,
+ hooks_only => 0,
);
-GetOptions(\%options,'quick|Q+','quiet|q!','debug|d+','help|h|?','man|m','verbose|v+');
+GetOptions(\%options,'quick|Q+','quiet|q!','debug|d+','help|h|?','man|m','verbose|v+','hooks_only|hooks-only');
pod2usage() if $options{help};
pod2usage({verbose=>2}) if $options{man};
my $HOSTNAME=qx(hostname);
$HOSTNAME=~s/\n//g;
my $CAN_IGNORE_EXTERNALS = 0;
-qx(svn --version) =~ /\(r(\d+)\)/;
-if ($1 > 13838) {
- $CAN_IGNORE_EXTERNALS = 1;
+if (not $options{hooks_only}) {
+ qx(svn --version) =~ /\(r(\d+)\)/;
+ if ($1 > 13838) {
+ $CAN_IGNORE_EXTERNALS = 1;
+ }
}
sub available_config_files{
}
while (my ($repo,$run_after) = each(%repos)) {
- if (-e "$repo/.svn") {
- print "Checking [$repo]\n";
+ print "Checking [$repo]\n";
+ if (-e "$repo/.svn" and not $options{hooks_only}) {
system('svn',
$command,
(not $VERBOSE and $options{quiet})?'-q':(),
$repo,
);
}
- if ($command =~ /^up(?:date)|checkout$/) {
+ if ($command =~ /^up(?:date)?|checkout$/) {
system('sh', '-c',"$run_after $repo") if defined $run_after and length $run_after;
}
}