Osama Ahmad
Osama Ahmad

Reputation: 815

list directory entries in the svn repository?

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.

Upvotes: 10

Views: 36217

Answers (1)

Mark O'Connor
Mark O'Connor

Reputation: 77951

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

Upvotes: 30

Related Questions