【问题标题】:How to list SVN tags and its revisions from command line如何从命令行列出 SVN 标签及其修订版
【发布时间】:2013-07-13 13:02:19
【问题描述】:

我需要修改不同的标签。到目前为止,我在 SmartSVN 中使用了标签浏览器。但是它很慢。

svn ls "^/tags" 这样的东西只显示标签而不显示修订。 和类似的东西

svn log /path/to/tag -v --stop-on-copy 

提供了太多不必要的混乱信息。

是否有 svn 命令可以只获取标签及其修订版?

【问题讨论】:

    标签: svn command-line tags revisions


    【解决方案1】:

    您可以通过添加选项-v来查看每个标签最近提交的修订号:

    svn ls -v ^/tags
    

    如果要处理结果,我建议使用命令行svn info --xml --depth=immediates ^/tags 并使用脚本解析XML 文档。例如,下面的 python 脚本打印标签的名称及其修订号:

    #! /usr/bin/env python3
    import sys, lxml.etree
    document = lxml.etree.parse(sys.stdin.buffer)
    for entry in document.xpath('//entry[@kind="dir"]'):
        print(entry.xpath('string(@path)'), entry.xpath('string(commmit/@revision)'))
    

    【讨论】:

      猜你喜欢
      • 2012-10-06
      • 2011-01-15
      • 2011-05-23
      • 1970-01-01
      • 2017-04-06
      • 2015-12-27
      • 2011-04-22
      • 2017-09-07
      • 1970-01-01
      相关资源
      最近更新 更多