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

curcuru 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 fb2feb05 Workaround svn.update() limitation where it won't create a 
new blank file
fb2feb05 is described below

commit fb2feb053789e8cba0d73110f36ee852adaa7448
Author: Shane Curcuru <[email protected]>
AuthorDate: Sat Feb 1 13:30:09 2025 -0500

    Workaround svn.update() limitation where it won't create a new blank file
---
 lib/whimsy/asf/member-files.rb | 19 +------------------
 www/members/nominate_board.cgi |  5 +----
 2 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/lib/whimsy/asf/member-files.rb b/lib/whimsy/asf/member-files.rb
index bfd5711d..954b6e4b 100644
--- a/lib/whimsy/asf/member-files.rb
+++ b/lib/whimsy/asf/member-files.rb
@@ -219,29 +219,12 @@ module ASF
 
     # create a single director ballot statement (if not present)
     # @param availid of director nominee
-    # @return string for transcript (blank if success; svn_ does it's own 
output) 
     def self.add_board_ballot(env, wunderbar, availid, msg=nil, opt={})
       bdir = File.join(latest_meeting(), BOARD_BALLOT)
       bfile = File.join(bdir, "#{availid}#{BOARD_BALLOT_EXT}")
       ASF::SVN.update(bfile, msg || "Adding board_ballot template for 
#{$availid}", env, wunderbar, opt) do |_tmpdir, contents|
-        contents # Don't change existing contents
+        "#{contents} " # Merely add space to contents because blank files not 
suppored by svn.update()
       end
-      # Dir.mktmpdir do |tmpdir|
-      #   credentials = {user: $USER, password: $PASSWORD}.merge(opt)
-      #   # TODO: investigate if we should to --depth empty and attempt to get 
only that mentor's file
-      #   ASF::SVN.svn_('checkout', [File.join(latest_meeting(), 
BOARD_BALLOT), tmpdir], wunderbar, credentials)
-      #   Dir.chdir tmpdir do
-      #     if File.exist? fn
-      #       # All we need to do is create a file if it doesn't already 
exist, so just skip
-      #       return "Note: board_ballot/#{fn}, already exists, nothing to do!"
-      #     else
-      #       File.write('') # We create an empty file, if candidate accepts, 
they edit
-      #       ASF::SVN.svn_('add', fn, wunderbar)
-      #       ASF::SVN.svn_('commit', fn, wunderbar, {msg: "Adding 
board_ballot template for #{$availid}"}.merge(credentials))
-      #       return 
-      #     end
-      #   end
-      # end
     end
 
     # update the board nominees
diff --git a/www/members/nominate_board.cgi b/www/members/nominate_board.cgi
index 2b335967..d1ddb89b 100755
--- a/www/members/nominate_board.cgi
+++ b/www/members/nominate_board.cgi
@@ -83,10 +83,7 @@ def process_form(formdata: {}, wunderbar: {})
   })
 
   environ = Struct.new(:user, :password).new($USER, $PASSWORD)
-  _div.transcript do
-    tmp = ASF::MemberFiles.add_board_ballot(environ, wunderbar, 
"#{formdata['availid']}", "board_ballot/ += #{formdata['availid']}")
-    _ tmp unless tmp.empty?
-  end
+  ASF::MemberFiles.add_board_ballot(environ, wunderbar, 
"#{formdata['availid']}", "board_ballot/ += #{formdata['availid']}")
   ASF::MemberFiles.update_board_nominees(environ, wunderbar, [entry], "+= 
#{formdata['availid']}")
   return true
 end

Reply via email to