Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list SVN tags and its revisions from command line

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?

like image 683
swo Avatar asked Jul 15 '13 15:07

swo


People also ask

How do I view tags in svn?

and tags, and then just "ls". You can run "svn list -h" for more info on list.

How do I find my svn revision history?

To find information about the history of a file or directory, use the svn log command. svn log will provide you with a record of who made changes to a file or directory, at what revision it changed, the time and date of that revision, and, if it was provided, the log message that accompanied the commit.

How do I tag a revision in svn?

If you want to create a snapshot of /calc/trunk exactly as it looks in the HEAD revision, make a copy of it: $ svn copy http://svn.example.com/repos/calc/trunk \ http://svn.example.com/repos/calc/tags/release-1.0 \ -m "Tagging the 1.0 release of the 'calc' project." Committed revision 902.

How do I access TortoiseSVN from command line?

Locate TortoiseSVN and click on it. Select "Change" from the options available. Refer to this image for further steps. After completion of the command line client tools, open a command prompt and type svn help to check the successful install.


1 Answers

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)')) 
like image 147
nosid Avatar answered Sep 20 '22 11:09

nosid