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 9ce4f94e Optionally return age of file
9ce4f94e is described below

commit 9ce4f94e710550746f57178b6dfb0e66cb8b6f85
Author: Sebb <[email protected]>
AuthorDate: Thu Sep 12 21:34:52 2024 +0100

    Optionally return age of file
---
 lib/whimsy/asf/documents.rb | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/whimsy/asf/documents.rb b/lib/whimsy/asf/documents.rb
index 9b62e631..2fd265f4 100644
--- a/lib/whimsy/asf/documents.rb
+++ b/lib/whimsy/asf/documents.rb
@@ -271,17 +271,17 @@ module ASF
     end
   
     # Find the file name (or directory) that matches a person
-    # return [svnpath, name] if found
+    # return [svnpath, name, timestamp, epoch (int)] if found
     # return nil if not found
-    def self.findpath(userid, env)
+    def self.findpath(userid, env, getDates=false)
       reqdir = ASF::SVN.svnpath!(STEM)
-      list, err = ASF::SVN.listnames(reqdir, env.user, env.password)
-      if list
-        names = list.select{|x| x.start_with?("#{userid}.") or x == 
"#{userid}/"} # if there is a sig, then files are in a subdir
+      list, err = ASF::SVN.listnames(reqdir, env.user, env.password, getDates)
+      if list # This is a list of [names] or triples [name, ISO timestamp, 
epoch (int)]
+        names = list.select{|x,_y| x.start_with?("#{userid}.") or x == 
"#{userid}/"} # if there is a sig, then files are in a subdir
         if names.size == 1
           name = names.first
           path = ASF::SVN.svnpath!(STEM, name)
-          return [path, name]
+          return [path, name].flatten # this works equally well with or 
without dates
         end
         return nil
       else

Reply via email to