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
   lesmikes...@gmail.com

Reply via email to