[Bps-public-commit] r14718 - in Pushmi/trunk: . lib/Pushmi lib/Pushmi/Command

alexmv at bestpractical.com alexmv at bestpractical.com
Fri Aug 1 15:02:27 EDT 2008


Author: alexmv
Date: Fri Aug  1 15:02:27 2008
New Revision: 14718

Modified:
   Pushmi/trunk/   (props changed)
   Pushmi/trunk/bin/pushmi
   Pushmi/trunk/lib/Pushmi/Command.pm
   Pushmi/trunk/lib/Pushmi/Command/Mirror.pm
   Pushmi/trunk/lib/Pushmi/Command/Runhook.pm
   Pushmi/trunk/lib/Pushmi/Command/Runlock.pm
   Pushmi/trunk/lib/Pushmi/Command/Rununlock.pm
   Pushmi/trunk/lib/Pushmi/Command/Sync.pm
   Pushmi/trunk/lib/Pushmi/Command/Unlock.pm
   Pushmi/trunk/lib/Pushmi/Command/Verify.pm

Log:
 r35179 at kohr-ah:  chmrr | 2008-08-01 15:02:21 -0400
  * --silent, for when called after a fork


Modified: Pushmi/trunk/bin/pushmi
==============================================================================
--- Pushmi/trunk/bin/pushmi	(original)
+++ Pushmi/trunk/bin/pushmi	Fri Aug  1 15:02:27 2008
@@ -4,9 +4,6 @@
 use SVK::I18N;
 use Getopt::Long;
 
-close STDOUT;
-close STDERR;
-
 $SIG{INT} = sub {
     die loc("Interrupted.\n");
 };

Modified: Pushmi/trunk/lib/Pushmi/Command.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Command.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Command.pm	Fri Aug  1 15:02:27 2008
@@ -33,8 +33,16 @@
     });
 }
 
+sub options {
+    return ( "silent!" => "silent" );
+}
+
 sub run {
     my $self = shift;
+    if ($self->{silent}) {
+        close STDOUT;
+        close STDIN;
+    }
 
     # compat
     for ($self->subcommands) {

Modified: Pushmi/trunk/lib/Pushmi/Command/Mirror.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Command/Mirror.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Command/Mirror.pm	Fri Aug  1 15:02:27 2008
@@ -6,8 +6,6 @@
 
 my $logger = Pushmi::Config->logger('pushmi.svkmirror');
 
-sub options { () }
-
 sub run_with_auth {
     my ($self, $repospath, $url) = @_;
     my $pushmi = Pushmi::Mirror->new( path => $repospath );

Modified: Pushmi/trunk/lib/Pushmi/Command/Runhook.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Command/Runhook.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Command/Runhook.pm	Fri Aug  1 15:02:27 2008
@@ -9,7 +9,7 @@
 my $logger = Pushmi::Config->logger('pushmi.runhook');
 
 sub options {
-    ('txnname=s' => 'txnname')
+    return ( Pushmi::Command->options, 'txnname=s' => 'txnname' );
 }
 
 sub run_with_auth {

Modified: Pushmi/trunk/lib/Pushmi/Command/Runlock.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Command/Runlock.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Command/Runlock.pm	Fri Aug  1 15:02:27 2008
@@ -6,10 +6,13 @@
 my $logger = Pushmi::Config->logger('pushmi.runlock');
 
 sub options {
-    ( 'path=s'    => 'path',
-      'user=s'    => 'user',
-      'comment=s' => 'comment',
-      'steal'     => 'steal' );
+    return (
+        Pushmi::Command->options,
+        'path=s'    => 'path',
+        'user=s'    => 'user',
+        'comment=s' => 'comment',
+        'steal'     => 'steal'
+    );
 }
 
 sub run {

Modified: Pushmi/trunk/lib/Pushmi/Command/Rununlock.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Command/Rununlock.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Command/Rununlock.pm	Fri Aug  1 15:02:27 2008
@@ -6,10 +6,13 @@
 my $logger = Pushmi::Config->logger('pushmi.runlock');
 
 sub options {
-    ( 'path=s'  => 'path',
-      'user=s'  => 'user',
-      'token=s' => 'token',
-      'break'   => 'break' );
+    return (
+        Pushmi::Command->options,
+        'path=s'  => 'path',
+        'user=s'  => 'user',
+        'token=s' => 'token',
+        'break'   => 'break'
+    );
 }
 
 sub run {

Modified: Pushmi/trunk/lib/Pushmi/Command/Sync.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Command/Sync.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Command/Sync.pm	Fri Aug  1 15:02:27 2008
@@ -8,8 +8,11 @@
 my $logger = Pushmi::Config->logger('pushmi.sync');
 
 sub options {
-    ('nowait' => 'nowait',
-     'bootstrap=s' => 'bootstrap');
+    return (
+        Pushmi::Command->options,
+        'nowait'      => 'nowait',
+        'bootstrap=s' => 'bootstrap',
+    );
 }
 
 sub run_with_auth {

Modified: Pushmi/trunk/lib/Pushmi/Command/Unlock.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Command/Unlock.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Command/Unlock.pm	Fri Aug  1 15:02:27 2008
@@ -6,7 +6,7 @@
 my $logger = Pushmi::Config->logger('pushmi.unlock');
 
 sub options {
-    ( 'revision=i' => 'revision' )
+    return ( Pushmi::Command->options, 'revision=i' => 'revision' );
 }
 
 sub run_with_auth {

Modified: Pushmi/trunk/lib/Pushmi/Command/Verify.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Command/Verify.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Command/Verify.pm	Fri Aug  1 15:02:27 2008
@@ -9,10 +9,12 @@
 my $logger = Pushmi::Config->logger('pushmi.verify');
 
 sub options {
-    ( 'revision=i' => 'revision',
-      'enable'     => 'enable',
-      'correct'    => 'correct',
-    )
+    return (
+        Pushmi::Command->options,
+        'revision=i' => 'revision',
+        'enable'     => 'enable',
+        'correct'    => 'correct',
+    );
 }
 
 sub run_with_auth {



More information about the Bps-public-commit mailing list