Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a directory listing of a subversion repository

Tags:

svn

I have a client that is asking me to give them a listing of every file and folder in the source code (and then a brief explanation of the source tree). Is there an easy way to create some sort of decently formatted list like this from a subversion repository?

like image 757
Kyle Boon Avatar asked Sep 19 '08 05:09

Kyle Boon


3 Answers

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.

like image 196
Alan Storm Avatar answered Nov 17 '22 20:11

Alan Storm


More generally, you can use the tree utility (in *Nix systems) to print out such a list for any directory structure. It is installed by default in many distros. If it isn't in yours, you might check the standard repositories for it. For example, in Ubuntu, with the default repositories, "sudo apt-get install tree" should do the trick. Alternatively, there's a shell script using sed that implements it here. Once you have tree, just cd to the directory you'd like to print the listing for and type "tree" (redirect it to a file if you like).

This does require that you have a checkout of the repository, but you'll probably already have one in most cases. Note that this will also include the .svn directories, which is kind of a pain, but you can always pipe the output through a "grep -v .svn" that will strip out these lines, possibly with some additional magic to take out anything "underneath" such a .svn-containing line in the hierarchy (using sed or a procedural shell-script loop or similar).

like image 38
Matt J Avatar answered Nov 17 '22 19:11

Matt J


Do a checkout, then drop into a command prompt, cd to the right directory, and type something like

dir /a:d /s /b > listing.txt

(Assuming that you're on Windows, of course.)

like image 1
Thomas Avatar answered Nov 17 '22 19:11

Thomas