r44080 - in /scripts/KGB: lib/App/KGB/Client.pm lib/App/KGB/Client/ServerRef.pm script/kgb-client

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Sun Sep 13 20:44:59 UTC 2009


Author: dmn
Date: Sun Sep 13 20:44:54 2009
New Revision: 44080

URL: http://svn.debian.org/wsvn/?sc=1&rev=44080
Log:
add verbose option

Modified:
    scripts/KGB/lib/App/KGB/Client.pm
    scripts/KGB/lib/App/KGB/Client/ServerRef.pm
    scripts/KGB/script/kgb-client

Modified: scripts/KGB/lib/App/KGB/Client.pm
URL: http://svn.debian.org/wsvn/scripts/KGB/lib/App/KGB/Client.pm?rev=44080&op=diff
==============================================================================
--- scripts/KGB/lib/App/KGB/Client.pm (original)
+++ scripts/KGB/lib/App/KGB/Client.pm Sun Sep 13 20:44:54 2009
@@ -108,6 +108,10 @@
 define B<ignore_branch>, and a given commit is in a branch with that name, the
 branch name is not transmitted to the server. Module name is still transmitted.
 
+=item verbose
+
+Print diagnostic information.
+
 =back
 
 =cut
@@ -120,7 +124,7 @@
 use List::Util ();
 use base 'Class::Accessor::Fast';
 __PACKAGE__->mk_accessors(
-    qw( repo_id servers br_mod_re br_mod_re_swap ignore_branch ));
+    qw( repo_id servers br_mod_re br_mod_re_swap ignore_branch verbose ));
 
 =head1 CONSTRUCTOR
 
@@ -246,6 +250,11 @@
         }
     }
 
+    if ( $self->verbose and $branch ) {
+        print "Detected branch '$branch' and module '"
+            . ( $module // 'NONE' ) . "'\n";
+    }
+
     $branch = undef
         if $branch and $branch eq ( $self->ignore_branch // '' );
 

Modified: scripts/KGB/lib/App/KGB/Client/ServerRef.pm
URL: http://svn.debian.org/wsvn/scripts/KGB/lib/App/KGB/Client/ServerRef.pm?rev=44080&op=diff
==============================================================================
--- scripts/KGB/lib/App/KGB/Client/ServerRef.pm (original)
+++ scripts/KGB/lib/App/KGB/Client/ServerRef.pm Sun Sep 13 20:44:54 2009
@@ -77,6 +77,10 @@
 Specifies the timeout for the SOAP transaction in seconds. Defaults to 15
 seconds.
 
+=item B<verbose>
+
+Be verbose about communicating with KGB server.
+
 =back
 
 =head1 METHODS
@@ -109,7 +113,7 @@
 require v5.10.0;
 use base 'Class::Accessor::Fast';
 
-__PACKAGE__->mk_accessors( qw( uri proxy password timeout ) );
+__PACKAGE__->mk_accessors( qw( uri proxy password timeout verbose ) );
 
 use Carp qw(confess);
 use Digest::SHA1 qw(sha1_hex);
@@ -142,6 +146,12 @@
         $module // (), $self->password
     );
 
+    if ( $self->verbose ) {
+        print "About to contact ", $self->proxy, "\n";
+        print "Changes:\n";
+        print "  $_\n" for @{ $commit->changes };
+    }
+
     my $res = $s->commit(
         [   1, $repo_id,
             $checksum,

Modified: scripts/KGB/script/kgb-client
URL: http://svn.debian.org/wsvn/scripts/KGB/script/kgb-client?rev=44080&op=diff
==============================================================================
--- scripts/KGB/script/kgb-client (original)
+++ scripts/KGB/script/kgb-client Sun Sep 13 20:44:54 2009
@@ -133,6 +133,10 @@
 If you can only provide the module name in the first capture and the branch
 name in the second, use this option to signal the fact to B<kgb-client>.
 
+=item B<verbose>
+
+Makes the whole process more verbose.
+
 =back
 
 =head1 SUPPORTED VERSION CONTROL SYSTEMS
@@ -165,7 +169,7 @@
 use Getopt::Long;
 use YAML ();
 
-my( $conf_file, $uri, $proxy, $repo_id, $password, $timeout,
+my( $conf_file, $uri, $proxy, $repo_id, $password, $timeout, $verbose,
     $repo_type, @br_mod_re, $br_mod_re_swap, $ignore_branch, @servers,
 );
 GetOptions(
@@ -173,7 +177,7 @@
     'uri=s'     => \$uri,
     'proxy=s'   => \$proxy,
     'repo-id=s' => \$repo_id,
-    'pass=s'    => \$password,
+    'pass|word=s'=> \$password,
     'timeout=s'	=> \$timeout,
     'branch-and-module-re=s'    => \@br_mod_re,
     'br-mod-re=s' => \@br_mod_re,
@@ -181,6 +185,7 @@
     'br-mod-re!' => \$br_mod_re_swap,
     'ignore-branch=s'   => \$ignore_branch,
     'repository'=> \$repo_type,
+    'verbose!'=>\$verbose,
 ) or exit 1;
 
 if( $conf_file )
@@ -202,6 +207,7 @@
         App::KGB::Client::ServerRef->new(
             {   password => $password,
                 timeout  => $timeout,
+                verbose  => $verbose,
                 %$_
             }
             )
@@ -214,6 +220,7 @@
     {   uri      => $uri,
         password => $password,
         timeout  => $timeout,
+        verbose  => $verbose,
     }
     ) if $uri;
 
@@ -228,6 +235,7 @@
     br_mod_re      => \@br_mod_re,
     br_mod_re_swap => $br_mod_re_swap,
     ignore_branch  => $ignore_branch,
+    verbose        => $verbose,
 );
 
 $repo_type||= 'svn';
@@ -236,6 +244,9 @@
     my($path, $rev) = @ARGV;
     die "Repository path and revision must be given as arguments\n"
         unless $path and $rev;
+
+    print "Processing r$rev of SVN repository $path\n"
+        if $verbose;
 
     require App::KGB::Client::Subversion;
     my $client = App::KGB::Client::Subversion->new(




More information about the Pkg-perl-cvs-commits mailing list