通常当我执行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}' 也没有帮助,因为它只是评论位的一部分!
答案 0 :(得分: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}'