list directory entries in the svn repository?
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
How to list all files in a remote SVN repository?
This lists all files recursively:
svn ls -R URL-OF-REPO
Getting list of all folders but not the files
If you have access to the server (which I assume you do, given that you know well the size of the repository), you might consider using the svnlook
program. Like svn
, svnlook
offers a collection of subcommands. You'll want the svnlook tree
subcommand, and specifically the --full-paths
option which causes it to print its output one-path-per-line instead of using a nested/indented approach. Piped through a grep
that keeps only output which ends in a slash character (true only of directory paths), you'll have the list you seek.
$ svnlook tree /path/to/repos --full-paths | grep '/$'
/
/trunk/
/trunk/dir/
/trunk/otherdir/
/tags/
/tags/my-tag/
/tags/my-tag/dir/
/tags/my-tag/otherdir/
...
How can I create a directory listing of a subversion repository
You'll want the list command. Assuming you're using the command line client
svn list -R http://example.com/path/to/repos
This will give you a full recursive list of everything that's in the repository. Redirect it to a text file
svn list -R http://example.com/path/to/repos > file.txt
and then format to your heart's content.
How to get all files and directories from the SVN repository using java
"Authentication required" problem means that the server requires authentication but you didn't provide correct ISVNAuthenticationManager
implementation to SVNClientManager
. SVNKit supports different ways of authentication.
If you know what your credentials are, and they are fixed, you can use BasicAuthenticationManager
implementation.
If you want to use credentials, stored in your ~/.subversion
directory, use DefaultSVNAuthenticationManager
implementation (there's a convenient method to construct it:SVNWCUtil.createDefaultAuthenticationManager()
but note that this corresponds to Subversion commands with --non-interactive
option). Look at SVNCommandEnvironment#createClientAuthenticationManager() implementation if you need authentication manager that would allow to enter password from console.
And finally I'd like to notice that SVNClientManager is a part of obsolete (though still supported). Instead prefer SvnOperationFactory class like in my another answer, it also has setAuthenticationManager() setter.
I'm one of SVNKit developers if this matters.
Related Topics
How to Execute Shell Builtin from Scala
Graphics Card Memory and Virtual Address Space of a Process
On-The-Fly Output Redirection, Seeing The File Redirection Output While The Program Is Still Running
Linux: Checking If a Socket/Pipe Is Broken Without Doing a Read()/Write()
How to Clean Only Target in Buildroot
Which Suits Linux ? Gnu Make Vs Cmake Vs Codeblocks Vs Qmake
In a Sigill Handler, How to Skip The Offending Instruction
Getting Following Error After The Command Sudo Apt-Get Update on Ubuntu 16.04
How to Use Systemd to Restart a Service When Down
Bash Loop Through Directory Including Hidden File
Ubuntu Based Docker-Machine Image
Scsi Read (10) and Write (10) with The Scsi Generic Interface
File Format Differences Between a Static Library (.A) and a Shared Library (.So)