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

Re: Getting HEAD revision number from a URL

From: Juanma Barranquero <lektu_at_mi.madritel.es>
Date: 2004-10-27 02:45:18 CEST

On Tue, 26 Oct 2004 16:52:44 -0700, "Krebs, Steven" <steven.krebs@intel.com> wrote:

> FYI: here is my final solution (for svn client on WinXP with PERL):
>
> svn log -q -v -rHEAD <URI> | perl -nle "if(m/^r(\d+)/){~s/^r(\d+).*/set HeadRev=$1/;print;}"

Wouldn't it be shorter (à la Perl Golf) one of these?

  svn log -q -v -rHEAD <URI> | perl -ne "print'set HeadRev=',$1 if/^r(\d+)/"
  svn log -q -v -rHEAD <URI> | perl -ne "s/^r(\d+).*/set HeadRev=$1/&&print"
  svn log -q -v -rHEAD <URI> | perl -ne "s/^r(\d+)/print'set HeadRev=',$1/e"
  svn log -q -v -rHEAD <URI> | perl -ne "/^r(\d+)/&&print'set HeadRev=',$1"

(Sorry, couldn't resist ;)
  

                                                           /L/e/k/t/u

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Oct 27 02:45:42 2004

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.