[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: Les Mikesell <lesmikesell_at_gmail.com>
Date: Mon, 19 Apr 2010 16:44:49 -0500

On 4/19/2010 4:31 PM, Ryan Schmidt wrote:
> 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}'

 From the viewer's perspective, an 'element' is probably the same if it
is named the same even if it is deleted and re-added (making it not the
same from subversion's perspective). Would this catch the revisions
where a filename does/doesn't exist in those cases?

-- 
   Les Mikesell
    lesmikesell_at_gmail.com
Received on 2010-04-19 23:45:18 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.