[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: The value of HEAD

From: Bax, Arjen <ABax_at_AEGON.NL>
Date: 2005-04-08 10:19:57 CEST


To obtain the HEAD revision number, I wrote:

> svn log -rHEAD -q file:///d:/svnrep/mytools | perl -wlne '/^r(\d+)/ and do
{ print $1; exit }'

To which Ben Collins-Sussman responded:

> I prefer to run 'svn status -u' and just parse the last line.

Agreed, there is more than one way to do it (TIMTOWTDI, as is Perl's motto).
But Ben's command takes from the root of my WC with 3642 files 51 seconds,
where my own command only needs 2 seconds. Furthermore, I noticed that I can
shorten my command to

svn log -rHEAD -q | perl -wlne '/^r(\d+)/ and do { print $1; exit }'

omitting the URL.

Have a nice day.
Arjen Bax

Violence is the last refuge of the incompetent - Isaac Asimov
Received on Fri Apr 8 10:22:21 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.