You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2017/04/19 12:29:19 UTC

[whimsy] branch master updated: see if this will work on whimsy-vm4

This is an automated email from the ASF dual-hosted git repository.

rubys 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  ad2d31b   see if this will work on whimsy-vm4
ad2d31b is described below

commit ad2d31b424678f76921963cbed2f8771693e48d6
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Wed Apr 19 08:29:06 2017 -0400

    see if this will work on whimsy-vm4
---
 www/committers/subscribe.cgi | 55 ++++++++++++++++++++++++++++++++------------
 1 file changed, 40 insertions(+), 15 deletions(-)

diff --git a/www/committers/subscribe.cgi b/www/committers/subscribe.cgi
index 8230ff5..967f697 100755
--- a/www/committers/subscribe.cgi
+++ b/www/committers/subscribe.cgi
@@ -5,6 +5,8 @@ require 'wunderbar/bootstrap'
 require 'mail'
 require 'whimsy/asf'
 require 'time'
+require 'tmpdir'
+require 'escape'
 
 $SAFE = 1
 
@@ -79,22 +81,45 @@ _html do
         
         SUBREQ = 'https://svn.apache.org/repos/infra/infrastructure/trunk/subreq/'
         
-        # add file to svn (--revision 0 means it won't overwrite an existing file)
-        _.system ['svnmucc',
-          ['--revision', '0'],
-          '--message', "#{@list}@ += #{$USER}",
-          '--with-revprop', "whimsy:author=#{$USER}",
-          ['--no-auth-cache', '--non-interactive'],
-          ['--root-url', SUBREQ],
-          (['--username', $USER, '--password', $PASSWORD] if $PASSWORD),
-          '--', 'put', '-', fn],
-          stdin: request+ "\n" # seems to need extra EOL
+        rc = 999
+
+        Dir.mktmpdir do |tmpdir|
+          tmpdir.untaint
+
+          _.system ['svn', 'checkout', SUBREQ, tmpdir,
+            ['--no-auth-cache', '--non-interactive'],
+            (['--username', $USER, '--password', $PASSWORD] if $PASSWORD)]
+
+          Dir.chdir tmpdir do
+
+            if File.exist? fn
+              File.write(fn, request + "\n")
+              _.system ['svn', 'st']
+            else
+              File.write(fn, request + "\n")
+              _.system ['svn', 'add', fn]
+            end
+          
+            rc = _.system ['svn', 'commit', fn,
+              '--message', "#{@list}@ += #{$USER}",
+              ['--no-auth-cache', '--non-interactive'],
+              (['--username', $USER, '--password', $PASSWORD] if $PASSWORD)]
+          end
+        end
         
-        _div.alert.alert_success role: 'alert' do
-          _p do
-            _span.strong 'Request successfully submitted'
-            _ '(unless indicated otherwise above). You will be subscribed within the hour.'
-          end          
+        if rc == 0
+          _div.alert.alert_success role: 'alert' do
+            _p do
+              _span.strong 'Request successfully submitted'
+              _ 'You will be subscribed within the hour.'
+            end          
+          end
+        else
+          _div.alert.alert_danger role: 'alert' do
+            _p do
+              _span.strong 'Request Failed, see above for details'
+            end          
+          end
         end
       end
       unless _.post?

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].