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

Re: Call svn cat for all files modified or added in a given revision

From: Andy Levy <andy.levy_at_gmail.com>
Date: Tue, 20 Mar 2012 11:03:34 -0400

On Tue, Mar 20, 2012 at 10:39, OBones <obones_at_free.fr> wrote:
> Hello all,
>
> Using svn cat I can see the state of a file at a given revision.
> As it turns out, I have had in the past some files that were commit with
> inconsistent line endings and that are making analysis tools stop because of
> this.

Can you change analysis tools to one that can handle this condition?

> What I want to do is find which (file, revision) pairs are impacted so that
> I can go back in the past and fix those invalid commits (using dump/reload).
>
> However, I'm having a hard time finding a way to extract a list of modified
> or added files in a given revision so that I could give that list to the svn
> cat command that stops with an error when the above situation arises.
> And then, once this works, I'd put all this in a loop going from the first
> revision to the last one.

svn log --verbose -rX will give you a list of all paths touched in
revision X. You'll need to do some parsing to extract just the paths
vs. the other log data. If you're handy with XML, you can use svn log
--verbose --xml -rX and then use XPath to extract just the paths.

To parse the output of svn log --verbose for this project, look for
any line starting with one or more letters and/or spaces, followed by
a space, followed by a slash. From that space to the end of the line
is the path that was touched. The regex should be something close to
this:

\b[\w\s]+(\/*)\b
Received on 2012-03-20 16:04:48 CET

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.