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

Re: svn log --verbose not machine parsable?

From: Charles Lobo <charles.lobo_at_gmail.com>
Date: Fri, 13 Feb 2009 16:50:50 +0530

I just realized it may not be easy to see what the code is doing.

So for the benefit of anyone else who may run into the same problem -
to parse the plain text note that in the log output filenames start
with a "/".

Since "/" is not a valid filename character, this allows you to
identify where each file name is correctly. The first filename will
start with "/" after 5 characters, while the second (if it exists)
will start with the string "(from /".


On Fri, Feb 13, 2009 at 4:38 PM, Charles Lobo <charles.lobo_at_gmail.com> wrote:
> Good option. For now, I have been able to parse it correcly (attached
> code to earlier mail), so I'll stick with that. But I'll look @xml for
> future requirements.
> Thanks!
> /BD
> On Fri, Feb 13, 2009 at 4:33 AM, Hyrum K. Wright
> <hyrum_wright_at_mail.utexas.edu> wrote:
>> On Feb 12, 2009, at 7:37 AM, Charles Lobo wrote:
>>> Hello,
>>> I was writing a script that needed, as one of it's steps, to find all
>>> paths affected by a given revision.
>>> I figured "svn log --verbose" would be a good way to do it but I'm running
>>> into problems.
>>> Specifically, when the revision is created by a "svn cp" the log message
>>> is no longer parse-able. Take for instance the following steps:
>>> $svnadmin create /new
>>> $svn co file:///new
>>> $cd new
>>> $touch "strange (from without closing filename"
>>> $svn add "strange (from without closing filename"
>>> $svn ci -m "Test Step 1: Created funny file name"
>>> $svn cp "strange (from without closing filename" "new strange (from
>>> filename"
>>> $svn ci -m "Test Step 2: Did a copy to check log --verbose output"
>>> Basically, I have created a file called "new strange (from filename" which
>>> is a copy of another strangely named file. Now when I run svn log --verbose
>>> on this file it gives an un-parseable output (only because this is a copy):
>>> $svn log --verbose -r 2
>>> ------------------------------------------------------------------------
>>> r2 | charles.lobo | 2009-02-12 19:08:28 +0530 (Thu, 12 Feb 2009) | 1 line
>>> Changed paths:
>>> A /new strange (from filename (from /strange (from without closing
>>> filename:1)
>>> Test Step 2: Did a copy to check log --verbose output
>>> ------------------------------------------------------------------------
>>> One of the reasons we selected svn was because it was supposedly easy to
>>> script. But this is throwing a spanner in the works.
>>> Can anyone help?
>> If you are looking for machine parsable output, you should take a look at
>> the --xml switch. It works with most commands, including 'svn log'.
>> -Hyrum


To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-02-13 14:14:04 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.