Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search for file in subversion server?

Tags:

Is there a way to search for a file in a subversion repository?

Something similar to Unix' find command, with which I can find the location of a file in a repository.

I know there is svn list, but this gives me a list of all the files in a directory. I want to find the directory a file is in.

like image 670
lamcro Avatar asked Nov 06 '09 13:11

lamcro


People also ask

How do I find a file in svn repository?

Check out files from Subversion repositoryIn 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.

How do I search for a folder in svn?

Open your project folder. You will see question marks on folders that are associated with your VS project that have not yet been added to Subversion. Select those folders using Ctrl + Click, then right-click one of the selected items and select TortoiseSVN > Add. Select OK on the prompt.

How do I view svn files?

SVN has incremented the version of your file (NOT the repository… just the file) to the next logical revision, revision 2. If you want to review what's happened to your files then you can check this by selecting the top-level parent folder and clicking on the Visual SVN 'Show log' option.


1 Answers

You can use the following command, together with a grep, on the server:

svnlook tree --full-paths <repository path> | grep <file>

That's the fastest option if you need to look into a big repository.

If you only have access to the client side, again with a grep:

svn list -R <URL> | grep <file>

should do what you need.

Both will recurse through the directories, with the client you may start elsewhere than the root of the repository though, but it will be somewhat slower as the information has to go through the network (possibly).

Edit: Also, both gives you the option of looking into a past revision (should the file be deleted):

  • svn list -R -r <revision/revision range> <URL> and
  • svnlook tree -r <revision> <path>.

Simply type svn help list or svnlook help tree for further details.

like image 179
RedGlyph Avatar answered Sep 18 '22 19:09

RedGlyph