2

通常,当我执行 时svn log -v,我会得到以下格式的响应:

------------------------------------------------------------------------
r8223 | neo | 2013-04-23 10:51:46 +0200 (Tue, 23 Apr 2013) | 1 line
Changed paths:
   M /dir/myfile.py

mycomment: validation changes for customers
------------------------------------------------------------------------

但是说,我想列出 svn 提交的所有修订号,它们的评论中有“验证更改”。我怎么能列出来?

svn log -l 1000 -v |grep "验证更改"| awk '{print $somevalue}' 也无济于事,因为它只是评论位的一部分!

4

1 回答 1

0

Subversion 1.8+ 命令行客户端允许您在命令中使用新选项--search--search-and选项svn log

该命令不会在存储库内执行全文搜索,并且仅考虑以下数据:

  • 修订的作者(svn:author未版本化的属性),
  • 日期(svn:date未版本化的属性),
  • 记录消息文本(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.

因此,在您的情况下,命令可能是:

svn log -v --search "validation changes" URL-TO-REPOSITORY | awk '{print $somevalue}'

于 2014-08-06T12:28:45.987 回答