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: Use shorthand id for accessing SVN
Date Tue, 01 May 2018 22:25:20 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 e469be3  Use shorthand id for accessing SVN
e469be3 is described below

commit e469be3a4f711034f7ec30ddbdf8210a78588125
Author: Sebb <sebb@apache.org>
AuthorDate: Tue May 1 23:25:19 2018 +0100

    Use shorthand id for accessing SVN
    
    Also use File.join instead of '/'
---
 tools/membersort.rb                                  | 2 +-
 tools/migrate_podlings.rb                            | 4 ++--
 tools/proxyhelper.rb                                 | 6 +++---
 www/board/agenda/bin/remind-cronjob.rb               | 4 ++--
 www/board/agenda/main.rb                             | 2 +-
 www/board/agenda/models/comments.rb                  | 2 +-
 www/board/agenda/views/actions/publish.json.rb       | 6 +++---
 www/roster/views/actions/fullname.json.rb            | 2 +-
 www/roster/views/actions/memstat.json.rb             | 2 +-
 www/roster/views/actions/memtext.json.rb             | 2 +-
 www/secretary/workbench/views/actions/ccla.json.rb   | 2 +-
 www/secretary/workbench/views/actions/grant.json.rb  | 2 +-
 www/secretary/workbench/views/actions/icla.json.rb   | 2 +-
 www/secretary/workbench/views/actions/icla2.json.rb  | 4 ++--
 www/secretary/workbench/views/actions/memapp.json.rb | 4 ++--
 15 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/tools/membersort.rb b/tools/membersort.rb
index 98b1730..98df10d 100644
--- a/tools/membersort.rb
+++ b/tools/membersort.rb
@@ -3,7 +3,7 @@
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../lib', __FILE__))
 require 'whimsy/asf'
 
-FOUNDATION = ASF::SVN['private/foundation']
+FOUNDATION = ASF::SVN['foundation']
 
 Dir.chdir FOUNDATION
 
diff --git a/tools/migrate_podlings.rb b/tools/migrate_podlings.rb
index 39295af..4713f0e 100644
--- a/tools/migrate_podlings.rb
+++ b/tools/migrate_podlings.rb
@@ -1,8 +1,8 @@
 require 'whimsy/asf'
 require 'yaml'
 
-incubator_content = ASF::SVN['asf/incubator/public/trunk/content']
+incubator_content = ASF::SVN['incubator-content']
 ASF::Podlings.list.select{ |p| p.status == 'current'}.each_entry{ |podling|
-  pod_status_yml = "#{incubator_content}/podlings/#{podling.resource}.yml"
+  pod_status_yml = File.join(incubator_content, 'podlings', "#{podling.resource}.yml")
   File.open(pod_status_yml, 'w') {|f| f.write(podling.default_status.to_yaml) }
 }
\ No newline at end of file
diff --git a/tools/proxyhelper.rb b/tools/proxyhelper.rb
index d9c5daa..460e1e6 100644
--- a/tools/proxyhelper.rb
+++ b/tools/proxyhelper.rb
@@ -7,15 +7,15 @@ $LOAD_PATH.unshift File.realpath(File.expand_path('../../lib', __FILE__))
 require 'whimsy/asf'
 require 'mail'
 
-MEETINGS = ASF::SVN['private/foundation/Meetings']
+MEETINGS = ASF::SVN['Meetings']
 
 # Get IRC attendance copy/paste lines for all proxies at a meeting
 # @param meeting dir name of current meeting
 # @return reminders {"proxy@apache.org" => ["IRC line", ...]}
 # @see foundation/Meetings/*.rb for other scripts that deal with 
 #   IRC log parsing, attendance marking, and proxy handling
-def reminder_lines(meeting = File.basename(Dir["#{MEETINGS}/2*"].sort.last).untaint)
-  lines = IO.read("#{MEETINGS}/#{meeting}/proxies")
+def reminder_lines(meeting = File.basename(Dir[File.join(MEETINGS, '2*')].sort.last).untaint)
+  lines = IO.read(File.join(MEETINGS, meeting, 'proxies'))
   proxylist = lines.scan(/\s\s(.{25})(.*?)\((.*?)\)/).map { |l| [l[0].strip, l[1].strip,
l[2]]} # [["Shane Curcuru    ", "David Fisher ", "wave"], ...]
   copyproxy = Hash.new{|h,k| h[k] = [] }
   proxylist.each do |arr|
diff --git a/www/board/agenda/bin/remind-cronjob.rb b/www/board/agenda/bin/remind-cronjob.rb
index 5e440ad..ad9fef2 100644
--- a/www/board/agenda/bin/remind-cronjob.rb
+++ b/www/board/agenda/bin/remind-cronjob.rb
@@ -14,7 +14,7 @@ require 'whimsy/asf/agenda'
 require 'mail'
 require 'listen'
 
-FOUNDATION_BOARD = ASF::SVN['private/foundation/board']
+FOUNDATION_BOARD = ASF::SVN['foundation_board']
 AGENDA_WORK = ASF::Config.get(:agenda_work).untaint || '/srv/agenda'
 
 require './models/agenda'
@@ -24,7 +24,7 @@ require './models/agenda'
 reminder = eval(File.read("views/actions/reminder-text.json.rb"))
 
 # send reminders
-@agenda = File.basename(Dir["#{FOUNDATION_BOARD}/board_agenda_*.txt"].sort.last)
+@agenda = File.basename(Dir[File.join(FOUNDATION_BOARD, 'board_agenda_*.txt')].sort.last)
 @from = "Whimsy <no-reply@apache.org>"
 @dryrun = true
 @subject = reminder[:subject]
diff --git a/www/board/agenda/main.rb b/www/board/agenda/main.rb
index 4f589d2..3ee9ee3 100755
--- a/www/board/agenda/main.rb
+++ b/www/board/agenda/main.rb
@@ -33,7 +33,7 @@ if ENV['RACK_ENV'] == 'test'
   STDERR.puts "* SVN board  : #{FOUNDATION_BOARD}"
   STDERR.puts "* Agenda work: #{AGENDA_WORK}"
 else
-  FOUNDATION_BOARD = ASF::SVN['private/foundation/board']
+  FOUNDATION_BOARD = ASF::SVN['foundation_board']
   AGENDA_WORK = ASF::Config.get(:agenda_work).untaint || '/srv/agenda'
   STDERR.puts "* SVN board  : #{FOUNDATION_BOARD}"
   STDERR.puts "* Agenda work: #{AGENDA_WORK}"
diff --git a/www/board/agenda/models/comments.rb b/www/board/agenda/models/comments.rb
index 20a36a9..0678b70 100644
--- a/www/board/agenda/models/comments.rb
+++ b/www/board/agenda/models/comments.rb
@@ -11,7 +11,7 @@ class HistoricalComments
     cutoff = (Date.today - 380).strftime('board_agenda_%Y_%m_%d')
 
     # select and sort agendas for meetings past the cutoff
-    agendas = Dir["#{ASF::SVN['private/foundation/board']}/**/board_agenda_*"].
+    agendas = Dir[File.join(ASF::SVN['foundation_board'], '**', 'board_agenda_*')].
       select {|file| File.basename(file) > cutoff}.
       sort_by {|file| File.basename(file)}.
       map {|file| file.untaint}
diff --git a/www/board/agenda/views/actions/publish.json.rb b/www/board/agenda/views/actions/publish.json.rb
index 4fdc5f3..1508dbe 100755
--- a/www/board/agenda/views/actions/publish.json.rb
+++ b/www/board/agenda/views/actions/publish.json.rb
@@ -8,8 +8,8 @@ require 'whimsy/asf/svn'
 CONTENT = 'asf/infrastructure/site/trunk/content'
 BOARD_SITE = ASF::SVN["#{CONTENT}/foundation/board"]
 MINUTES = ASF::SVN["#{CONTENT}/foundation/records/minutes"]
-BOARD_PRIVATE = ASF::SVN['private/foundation/board']
-CALENDAR = "#{BOARD_SITE}/calendar.mdtext"
+BOARD_PRIVATE = ASF::SVN['foundation_board']
+CALENDAR = File.join(BOARD_SITE, 'calendar.mdtext')
 
 # update from svn
 [MINUTES, BOARD_SITE, BOARD_PRIVATE].each do |dir| 
@@ -53,7 +53,7 @@ ASF::SVN.update MINUTES, @message, env, _ do |tmpdir|
     _.system "svn add #{yeardir}"
   end
 
-  if not File.exist? "#{yeardir}/board_minutes_#{@date}.txt"
+  if not File.exist? File.join(yeardir, "board_minutes_#{@date}.txt")
     _.system "cp #{BOARD_PRIVATE}/board_minutes_#{@date}.txt #{yeardir}"
     _.system "svn add #{yeardir}/board_minutes_#{@date}.txt"
   end
diff --git a/www/roster/views/actions/fullname.json.rb b/www/roster/views/actions/fullname.json.rb
index a882e2d..7dd3a34 100644
--- a/www/roster/views/actions/fullname.json.rb
+++ b/www/roster/views/actions/fullname.json.rb
@@ -36,7 +36,7 @@ end
 
 # update iclas.txt
 if message
-  icla_txt = ASF::SVN['private/foundation/officers/iclas.txt']
+  icla_txt = File.join(ASF::SVN['officers'], 'iclas.txt')
   _svn.update icla_txt, message: message do |dir, text|
     # replace legal and public names in icla record
     userid = Regexp.escape(@userid)
diff --git a/www/roster/views/actions/memstat.json.rb b/www/roster/views/actions/memstat.json.rb
index c05fe6f..297ce1a 100644
--- a/www/roster/views/actions/memstat.json.rb
+++ b/www/roster/views/actions/memstat.json.rb
@@ -3,7 +3,7 @@ entry = ASF::Person.find(@userid).members_txt(true)
 raise Exception.new("unable to find member entry for #{userid}") unless entry
 
 # identify file to be updated
-members_txt = ASF::SVN['private/foundation/members.txt']
+members_txt = File.join(ASF::SVN['foundation'], 'members.txt')
 
 # construct commit message
 message = "Move #{ASF::Person.find(@userid).member_name} to #{@action}"
diff --git a/www/roster/views/actions/memtext.json.rb b/www/roster/views/actions/memtext.json.rb
index 2d38505..37374a5 100644
--- a/www/roster/views/actions/memtext.json.rb
+++ b/www/roster/views/actions/memtext.json.rb
@@ -3,7 +3,7 @@ entry = ASF::Person.find(@userid).members_txt(true)
 raise Exception.new("unable to find member entry for #{userid}") unless entry
 
 # identify file to be updated
-members_txt = ASF::SVN['private/foundation/members.txt']
+members_txt = File.join(ASF::SVN['foundation'], 'members.txt')
 
 # construct commit message
 message = "Update entry for #{ASF::Person.find(@userid).member_name}"
diff --git a/www/secretary/workbench/views/actions/ccla.json.rb b/www/secretary/workbench/views/actions/ccla.json.rb
index 3a2ad11..f453387 100644
--- a/www/secretary/workbench/views/actions/ccla.json.rb
+++ b/www/secretary/workbench/views/actions/ccla.json.rb
@@ -13,7 +13,7 @@ fileext = File.extname(@selected).downcase if @signature.empty?
 
 # verify that a CCLA under that name doesn't already exist
 if "#@filename#{fileext}" =~ /\w[-\w]*\.?\w*/
-  ccla = "#{ASF::SVN['private/documents/cclas']}/#@filename#{fileext}"
+  ccla = "#{ASF::SVN['cclas']}/#@filename#{fileext}"
   if File.exist? ccla.untaint
     _warn "documents/cclas/#@filename#{fileext} already exists"
   end
diff --git a/www/secretary/workbench/views/actions/grant.json.rb b/www/secretary/workbench/views/actions/grant.json.rb
index 64e613c..b9b64fe 100644
--- a/www/secretary/workbench/views/actions/grant.json.rb
+++ b/www/secretary/workbench/views/actions/grant.json.rb
@@ -13,7 +13,7 @@ fileext = File.extname(@selected).downcase if @signature.empty?
 
 # verify that a grant under that name doesn't already exist
 if "#@filename#{fileext}" =~ /\w[-\w]*\.?\w*/
-  grant = "#{ASF::SVN['private/documents/grants']}/#@filename#{fileext}"
+  grant = "#{ASF::SVN['grants']}/#@filename#{fileext}"
   if File.exist? grant.untaint
     _warn "documents/grants/#@filename#{fileext} already exists"
   end
diff --git a/www/secretary/workbench/views/actions/icla.json.rb b/www/secretary/workbench/views/actions/icla.json.rb
index e5d0845..170e854 100644
--- a/www/secretary/workbench/views/actions/icla.json.rb
+++ b/www/secretary/workbench/views/actions/icla.json.rb
@@ -15,7 +15,7 @@ fileext = File.extname(@selected).downcase if @signature.empty?
 
 # verify that an ICLA under that name doesn't already exist
 if "#@filename#{fileext}" =~ /\w[-\w]*\.?\w*/
-  icla = "#{ASF::SVN['private/documents/iclas']}/#@filename#{fileext}"
+  icla = "#{ASF::SVN['iclas']}/#@filename#{fileext}"
   if File.exist? icla.untaint
     _warn "documents/iclas/#@filename#{fileext} already exists"
   end
diff --git a/www/secretary/workbench/views/actions/icla2.json.rb b/www/secretary/workbench/views/actions/icla2.json.rb
index dddf8b7..b9f4848 100644
--- a/www/secretary/workbench/views/actions/icla2.json.rb
+++ b/www/secretary/workbench/views/actions/icla2.json.rb
@@ -22,7 +22,7 @@ _personalize_email(env.user)
 #                        move existing document                        #
 ########################################################################
 
-iclas = ASF::SVN['private/documents/iclas'].untaint
+iclas = ASF::SVN['iclas'].untaint
 @filename.untaint if @filename =~ /\A\w[-.\w]*\z/
 
 if not Dir.exist? "#{iclas}/#@filename"
@@ -59,7 +59,7 @@ end
 ########################################################################
 
 # determine initial value for the counter
-svndir = ASF::SVN['https://svn.apache.org/repos/private/documents/iclas']
+svndir = ASF::SVN['iclas']
 count = (Dir["#{svndir}/#@filename/*"].
       map {|name| name[/.*(\d+)\./, 1] || 1}.map(&:to_i).max || 1) + 1
 
diff --git a/www/secretary/workbench/views/actions/memapp.json.rb b/www/secretary/workbench/views/actions/memapp.json.rb
index 89d5c57..52ed46c 100644
--- a/www/secretary/workbench/views/actions/memapp.json.rb
+++ b/www/secretary/workbench/views/actions/memapp.json.rb
@@ -14,7 +14,7 @@ fileext = File.extname(@selected).downcase if @signature.empty?
 
 # verify that a membership form under that name doesn't already exist
 if "#@filename#{fileext}" =~ /\w[-\w]*\.?\w*/
-  form = "#{ASF::SVN['private/documents/member_apps']}/#@filename#{fileext}"
+  form = "#{ASF::SVN['member_apps']}/#@filename#{fileext}"
   if File.exist? form.untaint
     _warn "documents/member_apps/#@filename#{fileext} already exists"
   end
@@ -188,7 +188,7 @@ end
 ########################################################################
 
 task "svn commit memapp-received.text" do
-  meetings = ASF::SVN['private/foundation/Meetings']
+  meetings = ASF::SVN['Meetings']
   file = Dir["#{meetings}/2*/memapp-received.txt"].sort.last.untaint
   received = File.read(file)
   if received =~ /^no\s+\w+\s+\w+\s+\w+\s+#{@availid}\s/

-- 
To stop receiving notification emails like this one, please contact
sebb@apache.org.

Mime
View raw message