如何在svn存储库中搜索任何修订版本中是否存在文件

Man*_*anu 26 svn tortoisesvn

如何搜索命名的文件foo.txt是否曾提交到我的svn存储库(在任何修订版中)?

Mar*_*man 38

右键单击签出文件夹的root> TortoiseSVN> Show Log

您也可以在那里输入文件名.


Ada*_*ire 10

这应该适合你:

svn log -r 0:HEAD -v $REPOSITORY_PATH | grep "/foo.txt"
Run Code Online (Sandbox Code Playgroud)

这将为您提供文件的路径和日志中的状态.如果你有任何点击,你知道它在某些时候存在.如果没有结果,那么任何版本的存储库中的任何地方都没有任何匹配.您还将看到每个日志行的状态,例如:

   A /some/path/foo.txt
   D /some/path/foo.txt

但我猜这些额外的信息对你来说不是问题.:)


bah*_*rep 5

使用Subversion 1.8+客户端,新的--search--search-and选项可用于svn log命令.这些选项不允许在存储库中执行全文搜索,仅查找以下数据:

  • 修订版的作者(svn:author无版权财产),
  • 日期(svn:date无版权财产),
  • 日志消息文本(svn:log无版本属性),
  • 已更改路径的列表(即受特定修订影响的路径).

据我猜,您可以使用以下命令行搜索"foo.txt":

svn log -v --search "foo.txt".

以下是有关这些新svn log搜索选项的完整帮助页面:

 If the --search option is used, log messages are displayed only if the
 provided search pattern matches any of the author, date, log message
 text (unless --quiet is used), or, if the --verbose option is also
 provided, a changed path.
 The search pattern may include "glob syntax" wildcards:
     ?      matches any single character
     *      matches a sequence of arbitrary characters
     [abc]  matches any of the characters listed inside the brackets
 If multiple --search options are provided, a log message is shown if
 it matches any of the provided search patterns. If the --search-and
 option is used, that option's argument is combined with the pattern
 from the previous --search or --search-and option, and a log message
 is shown only if it matches the combined search pattern.
 If --limit is used in combination with --search, --limit restricts the
 number of log messages searched, rather than restricting the output
 to a particular number of matching log messages.
Run Code Online (Sandbox Code Playgroud)