如何在Subversion服务器中搜索文件? [英] How to search for file in subversion server?

查看:169
本文介绍了如何在Subversion服务器中搜索文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在Subversion版本库中搜索文件?



类似于Unix的 find 命令,我可以找到一个文件在存储库中的位置。



我知道有 svn list ,但是这给了我一个目录中所有文件的列表。我想找到一个文件所在的目录。

解决方案

您可以使用下面的命令和grep一起服务器:

  svnlook树 - 完整路径<资料库路径> | grep< file> 

如果您需要查看大型资源库,这是最快的选择。 b

如果您只能访问客户端,再次使用grep:

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

应该做你所需要的。

两者都会通过目录进行递归,客户端可能会从存储库的根目录开始,但是信息必须通过网络(可能)才会慢一些。



编辑:另外,两者都可以让您选择查看过去的修订版(应删除文件): >

  • svn list -R -r< revision / revision range> < URL>

  • svnlook树-r< revision> < path>



  • 只需键入 svn help list svnlook help tree 获取更多详细信息。


    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.

    解决方案

    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.

    这篇关于如何在Subversion服务器中搜索文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆