开发者

How to search for file in subversion server?

开发者 https://www.devze.com 2022-12-10 22:15 出处:网络
Is there a way to search for a file in a subversion re开发者_JAVA百科pository? Something similar to Unix\' find command, with which I can find the location of a file in a repository.

Is there a way to search for a file in a subversion re开发者_JAVA百科pository?

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消