从给定的SVN存储库,我正在尝试编写脚本来查找创建分支的修订。在TortoiseSVN修订图中,您可以轻松发现它们,所以我想这是可能的。
到目前为止,我几乎可以通过解析xml格式的完整详细日志(svn log -v --xml
)并过滤logentry
节点(带迷你模块的Python)来实现:
liste_revision = [item for item in doc.getElementsByTagName('logentry')
if (item.getElementsByTagName('path').length==1 and
item.getElementsByTagName('path')[0].getAttribute('kind')=="dir" and
item.getElementsByTagName('path')[0].getAttribute('action')=="A" and
"/branches/" in item.getElementsByTagName('path')[0].firstChild.nodeValue)]
我说几乎是因为有一两件不需要的项目仍然通过这些过滤器。这个算法也很重,因为我正在过滤整个日志。
所以我的问题是:
svn log --stop-on-copy
,但它看起来只适用于当前的分支。