Subversion: Determine the highest revision number in the working copy

This seems to do the trick when run in a terminal from the top level of the working copy:

svn info -R  | grep Revision | sed "s/Revision: //g" | sort -n | tail -1

Updated
Or, you could just use the svnversion command.

2 comments

 
Anonymous wrote 4 years 30 weeks ago

I prefer awk ‘{print $2}’

I prefer awk ‘{print $2}’ instead of replacing with sed- 2 cuts the second field, alter as needed.

 
andy wrote 4 years 30 weeks ago

Thanks for the tip. What I

Thanks for the tip. What I don’t know about sed and awk could fill the Grand Canyon - I was pleased to have figured out enough sed to do that replacement at all!

Please register or login to post a comment.
Syndicate content

Twitter

  • RT @Crell An obituary for an old friend: http://bit.ly/gNdVIl #Drupal #Git #CVS 3 years 19 weeks ago
  • (That is to say, in hook_views_data(). #views #drupal) 3 years 19 weeks ago
  • #drupal #views3 gurus: Is it possible to declare a relationship with an intederminate base table & field? (TBD by the handler?) 3 years 19 weeks ago
  • I wrote a module and someone else figured out how to use it to pull Webform data into #Drupal views. http://bit.ly/hGDGGi 3 years 25 weeks ago
  • RT @nquabbinlodge Meeting tonight in Athol MA! Work of the evening: confer the 3rdº on 1 candidate. Dinner at 6, lodge opens at 7. 3 years 30 weeks ago

Older

Contact

Andy Chase
(978) 297-6402
andychase [at] gmail.com
GPG/PGP Public Key