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 49490159 List names for an SVN path [skip ci]
49490159 is described below

commit 494901591d4ed40387e011d6cde6a91917dc23ba
Author: Sebb <[email protected]>
AuthorDate: Sat Aug 31 13:31:31 2024 +0100

    List names for an SVN path [skip ci]
---
 lib/whimsy/asf/svn.rb | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index 41b22fc3..368511ba 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -285,6 +285,7 @@ module ASF
     end
 
     # retrieve list, [err] for a path in svn
+    # If timestamp is true, format is xml, else format is a single string with 
line-breaks
     def self.list(path, user=nil, password=nil, timestamp=false)
       if timestamp
         return self.svn(['list', '--xml'], path, {user: user, password: 
password})
@@ -293,6 +294,14 @@ module ASF
       end
     end
 
+    # retrieve array of names, [err] for a path in svn
+    # directories are suffixed with '/'
+    def self.listnames(path, user=nil, password=nil)
+        list, err = self.svn('list', path, {user: user, password: password})
+        return list.split(%r{\R}) if list
+        [list, err]
+    end
+
     # These keys are common to svn_ and svn
     VALID_KEYS = %i[user password verbose env dryrun msg depth quiet item 
revision xml]
 

Reply via email to