I need to list all directories and subdirectories recursively of a remote svn repo, I tried to use
svn list http://....myrepository -R --depth=infinity
but I get also the files.
Is there a vay to instruct "svn list" in order to list only the folders without using any post processing as grep...?
No i am pretty sure it is not possible as of release 1.14.
What svn ls
outputs is path and an option whether the path is a DIR or a FILE(you can check it out by exporting the ls in xml format). There is a search
option in svn ls that allows you to search "glob syntax" terms on path. There is no way to pass a glob argument to search
that will only filter out the directories. You will have to use a post processing like grep or use an output xml file.
Additional example information, if output from the
svn list http://....myrepository -R --depth=infinity
is
branch/folder1/
branch/folder1/file.file
And you try to search something as
svn list http://....myrepository -R --depth=infinity --search r"*/"
You will not get output of only folder1
as the /
is added after the list has been outputed to the terminal.
It would be interesting to know the use case though, where this would be needed.
unfortunately your suggestion does not work with the svn version I have
$ svn --version
svn, version 1.9.12
.....
svn list http://...myRepo -R --depth=infinity --search r"*/"
Subcommand 'list' doesn't accept option '--search ARG'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.