Q:

SVN: Pull latest revision number only

I am trying to run svn command that will be used in grunt shell that will allow me to pull only the latest revision number from HEAD. So when I do svn log -r HEAD it shows me all of the information for the latest. From that, I only need the revision number so I can add it to my app for developers to see what the last commit was. Is there a way to run a command to only get the latest revision number only?
Thank you

A:

Take a look at the info command:
$ svn info -r HEAD $REPO/trunk/proj
Path: trunk/project
URL: http://svn.vegicorp.net/repo/trunk
Relative URL: ^/trunk/proj
Repository Root: http://svn.vegicorp.net/repo
Repository UUID: dfa478bd-130c-4e4c-9ce8-d3cdc67c4965
Revision: 13406
Node Kind: directory
Last Changed Author: bob
Last Changed Rev: 13406
Last Changed Date: 2015-04-08 16:19:03 -0400 (Wed, 08 Apr 2015)

You can use awk or sed to pull out the data you want. The Revision is the revision of the whole repository. The Last Changed Rev is the last revision where something was changed on this particular URL. There's also a XML output by using --xml. If you can parse XML, that may make it easier to get the data you want.

