How to list SVN tags and its revisions from command line
Asked Answered
O

1

30

I need revisions of different tags. So far I used a Tag-Browser in SmartSVN. However it is quite slow.

Something like svn ls "^/tags" shows only the tags but no revisions. And something like

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

gives too much confusing information which is not needed.

Is there a svn command to get only tags and its revision?

Opinionative answered 15/7, 2013 at 15:33 Comment(0)
L
41

You can see the revision numbers of the most recent commit for each tag by adding the option -v:

svn ls -v ^/tags

If you want to process the results, I recommend using the command line svn info --xml --depth=immediates ^/tags and parsing the XML document with a script. For example, the following python script prints the names of the tags with their revision number:

#! /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)'))
Lorou answered 15/7, 2013 at 17:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.