You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2020/07/09 20:44:58 UTC
[whimsy] branch master updated: Get correct svn parent directory
for listings
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 26c67c6 Get correct svn parent directory for listings
26c67c6 is described below
commit 26c67c67de7c32ec7629fcfd71168b83d99e7700
Author: Sebb <se...@apache.org>
AuthorDate: Thu Jul 9 21:44:49 2020 +0100
Get correct svn parent directory for listings
---
lib/whimsy/asf/svn.rb | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index 432b20a..e517429 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -952,9 +952,23 @@ module ASF
private
+ # Calculate svn parent directory allowing for overrides
+ def self.svn_parent
+ svn = ASF::Config.get(:svn)
+ if svn.instance_of? String and svn.end_with? '/*'
+ File.dirname(svn)
+ else
+ File.join(ASF::Config.root,'svn')
+ end
+ end
+
+ # get listing names for updating and returning SVN directory listings
+ # Returns:
+ # [listing-name, temporary name]
def self.listingNames(name)
- return File.join(ASF::Config.root,'svn',"%s.txt" % name).untaint,
- File.join(ASF::Config.root,'svn',"%s.tmp" % name).untaint
+ dir = self.svn_parent
+ return File.join(dir,"%s.txt" % name).untaint,
+ File.join(dir,"%s.tmp" % name).untaint
end
# Get all the SVN entries