whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: DRY - use standard method
Date Sun, 24 Nov 2019 13:13:00 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 824a998  DRY - use standard method
824a998 is described below

commit 824a99878e1db5d71a90fbfef6790ed9cde28661
Author: Sebb <sebb@apache.org>
AuthorDate: Sun Nov 24 13:12:56 2019 +0000

    DRY - use standard method
---
 tools/svnupdate.rb | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/tools/svnupdate.rb b/tools/svnupdate.rb
index a1ebaa8..e4c6f74 100644
--- a/tools/svnupdate.rb
+++ b/tools/svnupdate.rb
@@ -18,7 +18,7 @@ def update(dir)
   File.open(LOG, File::RDWR|File::CREAT, 0644) do |log|
     log.flock(File::LOCK_EX)
 
-    $stderr.puts "#{Time.now} Updating #{dir}" # Temporary test
+    $stderr.puts "#{Time.now} Updating #{dir}" # Record updates
     Dir.chdir dir do
       $stderr.puts `svn cleanup`
       $stderr.puts `svn update`
@@ -30,31 +30,16 @@ end
 
 if mail.subject =~ %r{^board: r\d+ -( in)? /foundation/board} # board-commits@
 
-  # prevent concurrent updates being performed by the cron job
-  File.open(LOG, File::RDWR|File::CREAT, 0644) do |log|
-    log.flock(File::LOCK_EX)
-
-    Dir.chdir '/srv/svn/foundation_board' do
-      `svn cleanup`
-      `svn update`
-    end
-  end
+  update '/srv/svn/foundation_board'
 
 elsif mail.subject =~ %r{^foundation: r\d+ -( in)? /foundation} # foundation-commits@
+
   # includes members.txt
   update '/srv/svn/foundation'
 
 elsif mail.subject =~ %r{^committers: r\d+ -( in)? /committers/board} # committers-cvs@
 
-  # prevent concurrent updates being performed by the cron job
-  File.open(LOG, File::RDWR|File::CREAT, 0644) do |log|
-    log.flock(File::LOCK_EX)
-
-    Dir.chdir '/srv/svn/board' do
-      `svn cleanup`
-      `svn update`
-    end
-  end
+  update '/srv/svn/board'
 
 end
 


Mime
View raw message