[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-30 00:29:27 CEST

On Fri, 29 Oct 2004 11:07:41 -0700, "Peter Yamamoto" <peter.yamamoto@page44.com> wrote:

> Change the ' to ", and the internal " to \"...
>
> Works for me under WinXP cmd shell.
>
> C:\ProjectsSVN>svn log -q -v -rHEAD | perl -ne "/^r(\d+)/&&print \"set
> HeadRev=$
> 1\""
> set HeadRev=34

Sure, but then it's longer than my previous post.

"/^r(\d+)/&&print\"set HeadRev=$1\"" # Yours
"/^r(\d+)/&&print'set HeadRev=',$1" # Mine
'/^r(\d+)/&&print"set HeadRev=$1"' # J Robert Ray's

In fact, when I'm not Perl-golfing but doing one-liners for real, I
usually resort to qq():

perl -e "/^r(\d+)/ && print qq(set HeadRev=$1)"

etc.

                                                           /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 Sat Oct 30 00:30:19 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.