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

Re: How to get list of valid revision numbers for an element?

From: Ryan Schmidt <subversion-2010b_at_ryandesign.com>
Date: Mon, 19 Apr 2010 16:31:59 -0500

On Apr 19, 2010, at 14:55, David Weintraub wrote:
> On Mon, Apr 19, 2010 at 3:29 PM, KARR, DAVID (ATTSI) wrote:
>> I'm considering writing a script which (among other things) can iterate
>> through all the valid revisions for an element. I'm trying to figure
>> out the best way to do that. I could easily just start at "1" up to the
>> latest revision number, and just check for errors on each one, but that
>> seems pretty painful. Is there a straightforward way to get a list of
>> valid revision numbers for an element? I would like the ability to
>> start at the beginning and iterate to the latest, and also start at the
>> latest and iterate to the earliest.
>
> Why can't you take a "log" of that element? That'll give you all the revisions on which that element changed.

> $ svn log 1:HEAD $element #List from first to last
> $ svn log HEAD:1 $element #List from last to first.

You forgot a "-r" in there before the revision numbers. But better yet, if you just want the revision numbers (and not also the log messages, timestamps, authors, etc.):

$ svn log -q -r 1:HEAD $element | awk '/^r/ {print $1}'

$ svn log -q -r HEAD:1 $element | awk '/^r/ {print $1}'
Received on 2010-04-19 23:32:33 CEST

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.