[Libreoffice-commits] .: 2 commits - scratch/cia

Miklos Vajna vmiklos at kemper.freedesktop.org
Sun Dec 12 15:13:18 PST 2010


 scratch/cia/run-libreoffice-ciabot.pl |   49 ++++++++++++++++++++++++++++------
 1 file changed, 41 insertions(+), 8 deletions(-)

New commits:
commit 160cad380ebca6df3c9901d70434b895da707aa9
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Mon Dec 13 00:04:01 2010 +0100

    run-libreoffice-ciabot: announce all commits from newly created branches
    
    The side effect of this is that in case there is no new commit, just the
    branch is created, then nothing will be reported - in other words the
    script won't spam when it used to.

diff --git a/scratch/cia/run-libreoffice-ciabot.pl b/scratch/cia/run-libreoffice-ciabot.pl
index c731c5d..2029520 100644
--- a/scratch/cia/run-libreoffice-ciabot.pl
+++ b/scratch/cia/run-libreoffice-ciabot.pl
@@ -74,13 +74,21 @@ sub report($$$) {
             }
         }
         else {
-            # TODO at some stage, we could play with git merge-base, and
-            # report everything etc. but... ;-)
-            print "Sending report about $key in a newly created branch $key\n";
-            if (!$test) {
-                qx(libreoffice-ciabot.pl $repo $new_head $branch_name)
-            } else {
-                print "libreoffice-ciabot.pl '$repo' '$new_head' '$branch_name'\n";
+            # Report every commit which is not in master
+            if ( open COMMITS, "git rev-list $new_head ^refs/remotes/origin/master | tac |" ) {
+                while ( <COMMITS> ) {
+                    chomp;
+                    print "Sending report about $_ in $key (newly created branch)\n";
+                    if (!$test) {
+                        qx(libreoffice-ciabot.pl $repo $_ $branch_name)
+                    } else {
+                        print "libreoffice-ciabot.pl '$repo' '$_' '$branch_name'\n";
+                    }
+                }
+                close COMMITS;
+            }
+            else {
+                error( "Cannot call git rev-list." );
             }
         }
     }
commit f6825b4632e913f14a9647e42a90400054d01594
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Sun Dec 12 23:48:06 2010 +0100

    run-libreoffice-ciabot: add test mode

diff --git a/scratch/cia/run-libreoffice-ciabot.pl b/scratch/cia/run-libreoffice-ciabot.pl
index 0c6f892..c731c5d 100644
--- a/scratch/cia/run-libreoffice-ciabot.pl
+++ b/scratch/cia/run-libreoffice-ciabot.pl
@@ -51,7 +51,11 @@ sub report($$$) {
                         while ( <COMMITS> ) {
                             chomp;
                             print "Sending report about $_ in $key\n";
-                            qx(libreoffice-ciabot.pl $repo $_ $branch_name)
+                            if (!$test) {
+                                qx(libreoffice-ciabot.pl $repo $_ $branch_name)
+                            } else {
+                                print "libreoffice-ciabot.pl '$repo' '$_' '$branch_name'\n";
+                            }
                         }
                         close COMMITS;
                     }
@@ -61,15 +65,23 @@ sub report($$$) {
                 } else {
                     # just process the merge commit itself
                     print "Sending report about $new_head in $key\n";
-                    qx(libreoffice-ciabot.pl $repo $new_head $branch_name)
+                    if (!$test) {
+                        qx(libreoffice-ciabot.pl $repo $new_head $branch_name)
+                    } else {
+                        print "libreoffice-ciabot.pl '$repo' '$new_head' '$branch_name'\n";
+                    }
                 }
             }
         }
         else {
             # TODO at some stage, we could play with git merge-base, and
             # report everything etc. but... ;-)
-            print "Sending report about $_ in a newly created branch $key\n";
-            qx(libreoffice-ciabot.pl $repo $new_head $branch_name)
+            print "Sending report about $key in a newly created branch $key\n";
+            if (!$test) {
+                qx(libreoffice-ciabot.pl $repo $new_head $branch_name)
+            } else {
+                print "libreoffice-ciabot.pl '$repo' '$new_head' '$branch_name'\n";
+            }
         }
     }
 }
@@ -100,6 +112,12 @@ print "Checking for changes in the libreoffice repo & sending reports to CIA.vc.
     "writer"
 );
 
+$test = 0;
+
+if ($test) {
+    @all_repos = ("test");
+}
+
 chomp( my $cwd = `pwd` );
 
 my %old_ref;
@@ -121,6 +139,13 @@ while ( 1 ) {
 	$old_ref{$repo} = $new_ref;
     }
 
-    # check every 5 minutes
-    sleep 5*60;
+    if (!$test) {
+        # check every 5 minutes
+        sleep 5*60;
+    } else {
+        print "Hit enter to report...\n";
+        <STDIN>;
+    }
 }
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list