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 68cd47e9 We can now assume password-from-stdin is available
68cd47e9 is described below

commit 68cd47e9647339bc8ce826b09b28f5b97ae38bbd
Author: Sebb <[email protected]>
AuthorDate: Fri Sep 13 23:55:33 2024 +0100

    We can now assume password-from-stdin is available
    
    More useful verbose info
---
 lib/whimsy/asf/svn.rb | 30 +++++-------------------------
 1 file changed, 5 insertions(+), 25 deletions(-)

diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index 882dcb73..f70f817c 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -385,12 +385,8 @@ module ASF
         # password was supplied, add credentials
         if password
           cmd << ['--username', user, '--no-auth-cache']
-          if self.passwordStdinOK?()
-            stdin = password
-            cmd << ['--password-from-stdin']
-          else
-            cmd << ['--password', password]
-          end
+          stdin = password
+          cmd << ['--password-from-stdin']
         end
       end
 
@@ -825,15 +821,11 @@ module ASF
 
         sysopts = {}
         if env
-          if self.passwordStdinOK?()
-            syscmd << ['--username', env.user, '--password-from-stdin']
-            sysopts[:stdin] = env.password
-          else
-            syscmd << ['--username', env.user, '--password', env.password]
-          end
+          syscmd << ['--username', env.user, '--password-from-stdin']
+          sysopts[:stdin] = env.password
         end
         if options[:verbose]
-          _.system 'echo', [syscmd.flatten, sysopts.to_s]
+          _.system 'echo', [syscmd.flatten, "\n", commands.join("\n")]
         end
         if options[:dryrun]
           rc = _.system syscmd.insert(0, 'echo')
@@ -1121,18 +1113,6 @@ module ASF
       end
     end
 
-    # Does this host's installation of SVN support --password-from-stdin?
-    def self.passwordStdinOK?
-      return @svnHasPasswordFromStdin unless @svnHasPasswordFromStdin.nil?
-      out, _err, status = Open3.capture3('svn', 'help', 'cat', '-v')
-      if status.success? && out
-        @svnHasPasswordFromStdin = out.include? '--password-from-stdin'
-      else
-        @svnHasPasswordFromStdin = false
-      end
-      @svnHasPasswordFromStdin
-    end
-
     private
 
     # Calculate svn parent directory allowing for overrides

Reply via email to