Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

list directory entries in the svn repository?

Tags:

linux

svn

How can I write a bash script to list directory entries in the svn repository? I want to write bash file because i have a large number of repositories.

like image 370
Osama Ahmad Avatar asked Sep 19 '10 12:09

Osama Ahmad


People also ask

How do I list svn repositories?

svn list is most useful if you want to see what files a repository has without downloading a working copy: $ svn list http://svn.red-bean.com/repos/test/support README. txt INSTALL examples/ … For further details, see the earlier section the section called “Listing versioned directories”.

Where is the svn directory?

If the URL is file://C:\Path\to\repository then the path is C:\Path\to\repository .

What is working directory in svn?

Last modified: 04 August 2022. A working copy is a directory that contains a collection of files which you can use as your private work area, as well as some extra files, created and maintained by Subversion. For example, each directory in your working copy contains an administrative directory named . svn.


1 Answers

If you are the subversion administrator, the following command will return the directories located in your repository.

svnlook tree $REPO_DIR --full-paths | egrep "/$"

The trick is the grep command that is looking for a trailing "/" character in the name

Same trick works for the svn command as well

svn list $REPO_URL -R | egrep "/$"

Extra notes

To repeatedly run this command you can put it into a shell for loop

for url in $URL1 $URL2 $URL2
do
svn list $url -R | egrep "/$"
done
like image 194
Mark O'Connor Avatar answered Sep 19 '22 23:09

Mark O'Connor