[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: Peter Yamamoto <peter.yamamoto_at_page44.com>
Date: 2004-10-30 01:13:50 CEST

LOL I wasn't measuring length... I was responding to a user who said
that they couldn't use single quote for some reason.

Peter

-----Original Message-----
From: Juanma Barranquero [mailto:lektu@mi.madritel.es]
Sent: Friday, October 29, 2004 3:29 PM
To: Peter Yamamoto
Cc: Subversion Users
Subject: Re: Getting HEAD revision number from a URL

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 01:14:37 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.