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

Re: export every version of every file

From: si <sshnug.si_at_gmail.com>
Date: 2006-05-25 03:33:17 CEST

> I want to do this automatically for approximately 300 MS-Word documents.
> Some have been checked in 50 times.
> How do I do this? (wrap this in a for loop? under MS-Windows?)

You could use a batch file, windows script or NAnt or Ant.

As I prefer NAnt over batch files or windows scripts that's what
I'd use. But if you don't have experience in such tools you may
end up spending 2 days learning them anyway...

Anyway, as a quick'n'dirty guess, the recipe might look like:

1. Call 'svnlook history /repos' using <exec> task, capturing stdout to file

2. Use <foreach> task to loop over each revision (ignore non-numeric output
on first 2 lines)

3. Inside the <foreach> task call 'svnlook changed using repos/changed-path -rX'
using the <exec>, again capturing stdout to another file

4. Create another <foreach> task inside the existing <foreach>, iterating
over the svnlook changed output. That is, for each revision loop over each
changed item. You can use NAnt string functions to help with the parsing.

5. If the changed item is what you want (e.g. a word doc), call <exec> once
more to perform the svn export, as you now know the file name and the revision
in question.

As you want multiple repositories i'd make the repository (and path) a NAnt
property which can be parsed via command line. You could also use a NAnt
property to determine the files to be extracted (*.doc).

Hope that helps.


To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu May 25 03:34:36 2006

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.