问题描述
svn diff -r16369:HEAD --summarize
上面的命令列出了所有经过两次修改修改的文件.
Above command list all files which are changed b/w two revision.
但是我能找到用户 'sherkhan' 在 r16369 以上版本更改的所有内容吗?
But can i find all which which are changed above version r16369 by user 'sherkhan' ?
推荐答案
使用日志的搜索功能:
svn log -r16369:HEAD --search sherkhan -v
这可能会发现日志中提到了 sherkhan 而不仅仅是提交者的修订版.
That might find revisions where sherkhan is mentioned in the log and isn't just the committer.
但如果您真的需要,您可以编写一个脚本来过滤这些内容.或者您可以使用 --xml
并编写 xslt.或者您可以使用绑定编写一个程序来进行搜索.
But you could write a script to filter those if you really wanted. Or you could use --xml
and write xslt. Or you could use the bindings to write a program to do the searching.
我想您想要什么取决于您使用它的频率以及您的目标是什么.但这至少应该让你开始.
I guess what you want to depends on how often you're going to use this and what your goals are. But this should at least get you started.
XSLT 示例
不管怎样,我还是制作了一个 XSLT 示例
For the hell of it I went ahead and produced an XSLT example
在 user-changed-paths.xslt 中有以下内容:
With the following in user-changed-paths.xslt:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="user"/>
<xsl:output method="text" omit-xml-declaration="yes" />
<xsl:template match="/">
<xsl:for-each select="log/logentry">
<xsl:if test="author=$user">
<xsl:for-each select="paths/path">
<xsl:value-of select="." /><xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
然后运行以下命令:
svn log -r16369:HEAD --search sherkhan -v --xml |xsltproc --stringparam user sherkhan user-changed-paths.xslt - |排序 -u
这篇关于列出用户更改的黑白两个版本的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!