]> git.donarmstrong.com Git - bin.git/commitdiff
add a hook-only mode to sa
authorDon Armstrong <don@donarmstrong.com>
Sun, 7 May 2006 07:50:22 +0000 (07:50 +0000)
committerDon Armstrong <don@donarmstrong.com>
Sun, 7 May 2006 07:50:22 +0000 (07:50 +0000)
sa

diff --git a/sa b/sa
index 6772c51d0fdf5d4b6c9130fd08081a369a462a29..0baa72881aeb5043f48728e61121d0ad047b7aa4 100755 (executable)
--- a/sa
+++ b/sa
@@ -56,9 +56,10 @@ my %options = (quick           => 1,
               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};
@@ -127,8 +128,8 @@ else {
 }
 
 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':(),
@@ -138,7 +139,7 @@ while (my ($repo,$run_after) = each(%repos)) {
                 $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;
      }
 }