We are looking for a script that will traverse in recursive mode all subfolders and list all SVN repository URLs and the path where it was found.
It will be used on /home folder of a user.
Repository URL examples: Apache HTTP Server: https://svn.example.com/repos/MyRepo/MyProject/trunk. svnserve: svn://svn.example.com/repos/MyRepo/MyProject/branches/MyBranch. Direct access (Unix-style): file:///var/svn/repos/MyRepo/MyProject/tags/1.1.0.
Check out files from Subversion repository In the Get from Version Control dialog, click Add Repository Location and specify the repository URL. Click Check Out. In the dialog that opens, specify the destination directory where the local copy of the repository files will be created, and click OK.
Recursively find directories, and for each of them try to get the SVN info. If it is successfull, then don't descend into the directory and print the directory name.
find -type d -exec bash -c "svn info {} > /dev/null 2> /dev/null" \; -prune -print
This will list the directories.
If you want the repository info, you can add it in the middle of the find exec command.
find -type d -exec bash -c "svn info {} 2> /dev/null | grep URL" \; -prune -print
Edit:
I found much better results by only testing for the presence of an .svn
subdirectory. Then, svn info
is called once at the end and grepped for Path and URL. (Plus using -0 to prevent from spaces in filenames.)
find -type d -exec test -d "{}/.svn" \; -prune -print0 | xargs -0 svn info | grep -e '\(Path\|URL\)'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With