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: Simplify updateCI by using common svn() method
Date Thu, 04 Jun 2020 23:53:07 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 1abc586  Simplify updateCI by using common svn() method
1abc586 is described below

commit 1abc586b2f57fdea7de3d073f8047475df94be88
Author: Sebb <sebb@apache.org>
AuthorDate: Fri Jun 5 00:52:34 2020 +0100

    Simplify updateCI by using common svn() method
---
 lib/whimsy/asf/svn.rb | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index 3adac2a..92db8a9 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -366,17 +366,18 @@ module ASF
     # user and password are required because the default URL is private
     def self.updateCI(msg, env, options={})
       # Allow override for testing
-      ciURL = options[:url] || 'https://svn.apache.org/repos/private/committers/board'
+      ciURL = options[:url] || self.svnurl('board')
       Dir.mktmpdir do |tmpdir|
         # use dup to make testing easier
         user = env.user.dup.untaint
         pass = env.password.dup.untaint
         # checkout committers/board (this does not have many files currently)
-        Kernel.system 'svn', 'checkout', '--quiet',
-          '--no-auth-cache', '--non-interactive',
-          '--depth', 'files',
-          '--username', user , '--password', pass,
-          ciURL, tmpdir.untaint
+        out, err = self.svn('checkout', ciURL,
+          {flags: [tmpdir.untaint, '--quiet', '--depth', 'files'],
+           user: user, password: pass})
+
+        raise Exception.new("Checkout of board folder failed: #{err}") unless out
+
         # read in committee-info.txt
         file = File.join(tmpdir, 'committee-info.txt')
         info = File.read(file)
@@ -386,19 +387,13 @@ module ASF
         # write updated file to disk
         File.write(file, info)
 
-        # commit changes
-        rc = Kernel.system 'svn', 'commit', '--quiet',
-          '--no-auth-cache', '--non-interactive',
-          '--username', user, '--password', pass,
-          file, '--message', msg
+        # commit the updated file
+        out, err = self.svn('commit', file,
+          {flags: [tmpdir.untaint,'--quiet', '--message', msg],
+           user: user, password: pass})
 
-        if rc
-          # update cache
-          ASF::Committee.parse_committee_info(info)
-        else
-          # die
-          raise Exception.new('Update committee-info.txt failed')
-        end
+        raise Exception.new("Update of committee-info.txt failed: #{err}") unless out
+        
       end
     end
 


Mime
View raw message