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 6ef800c1 Reproduce svn.update method error
6ef800c1 is described below
commit 6ef800c1bb6a9f4d89d0f12fcf775df6f7fa5b0a
Author: Shane Curcuru <[email protected]>
AuthorDate: Sat Feb 1 09:14:40 2025 -0500
Reproduce svn.update method error
---
lib/whimsy/asf/member-files.rb | 26 +++++++++++++++++++++-----
www/members/nominate_board.cgi | 5 ++++-
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/lib/whimsy/asf/member-files.rb b/lib/whimsy/asf/member-files.rb
index cc3c83a4..bfd5711d 100644
--- a/lib/whimsy/asf/member-files.rb
+++ b/lib/whimsy/asf/member-files.rb
@@ -219,13 +219,29 @@ 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={})
- bfile = File.join(latest_meeting(), BOARD_BALLOT,
"#{availid}#{BOARD_BALLOT_EXT}")
- opt[:diff] = true unless opt.include? :diff # default to true
- ASF::SVN.update(bfile, msg || 'Adding board_ballot template', env,
wunderbar, opt) do |_tmpdir, contents|
- # We merely create this file if not already present; don't change
existing contents
- contents
+ 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
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 b09fde25..2b335967 100755
--- a/www/members/nominate_board.cgi
+++ b/www/members/nominate_board.cgi
@@ -83,7 +83,10 @@ def process_form(formdata: {}, wunderbar: {})
})
environ = Struct.new(:user, :password).new($USER, $PASSWORD)
- ASF::MemberFiles.add_board_ballot(environ, wunderbar,
"#{formdata['availid']}", "nominee statements += #{formdata['availid']}")
+ _div.transcript do
+ tmp = ASF::MemberFiles.add_board_ballot(environ, wunderbar,
"#{formdata['availid']}", "board_ballot/ += #{formdata['availid']}")
+ _ tmp unless tmp.empty?
+ end
ASF::MemberFiles.update_board_nominees(environ, wunderbar, [entry], "+=
#{formdata['availid']}")
return true
end