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

Re: Parseable output: --xml option for more commands

From: Leslie Kishalmi <lkishalmi_at_netbeans.org>
Date: 2005-01-14 19:34:23 CET

Julian Foad wrote:
> Julian Foad wrote:
>
>> As a next step I will propose XML formats for "status", "list" and
>> "blame".
>
>
> How about this format for "blame --xml" (non-XML shown first)?
> (Apologies for starting with the unrequested "blame --xml" - it just
> came first in the alphabet and seemed easiest too.)
>
> ~/src/subversion> svn blame ~/tmp/sandbox/t -v -r40:HEAD
> - - - hello -
> committed in r17
> - - - bye -
> committed in r32
> - - - Third
> line - committed in r33
> 52 julianfoad 2003-11-27 00:24:15 +0000 (Thu, 27 Nov 2003) Hello
> 61 julianfoad 2004-03-20 00:44:03 +0000 (Sat, 20 Mar 2004)
> ~/src/subversion> svn blame ~/tmp/sandbox/t --xml -v -r40:HEAD
> <?xml version="1.0" encoding="utf-8"?>
> <blame>
> <blameline>
> <text>hello - committed in r17</text>
> </blameline>
> <blameline>
> <text>bye - committed in r32</text>
> </blameline>
> <blameline>
> <text>Third line - committed in r33</text>
> </blameline>
> <blameline>
> <revision>52</revision>
> <author>julianfoad</author>
> <date>2003-11-27T00:24:15.385454Z</date>
> <text>Hello</text>
> </blameline>
> <blameline>
> <revision>61</revision>
> <author>julianfoad</author>
> <date>2004-03-20T00:44:03.836506Z</date>
> <text></text>
> </blameline>
> </blame>
>
> (Without "-v", the "date" elements are omitted, just like in the non-XML
> case.)
>
> A thought that won't go away is that "blame" really ought to return just
> the revision number for each line; the author, date, and any other
> revision-specific info - and even the line of text from the file - can
> be looked up separately. But I don't think that would be the most
> useful and convenient thing to do. Perhaps, though, the XML ought to
> contain a main section with just rev numbers and another (log-like)
> section that maps rev numbers to author, date, etc. My thoughts lie
> just on the side of that being an abstraction which would be suitable
> for a programming interface, whereas "--xml" really just needs to give a
> simple XML wrapping of the normal text output. Your thoughts?
>
> - Julian

I would prefer an xml layout similar to .svn/entries file Like:
> <blameline>
> <revision>52</revision>
> <author>julianfoad</author>
> <date>2003-11-27T00:24:15.385454Z</date>
> <text>Hello</text>
> </blameline>
> <blameline>
> <revision>61</revision>
> <author>julianfoad</author>
> <date>2004-03-20T00:44:03.836506Z</date>
> <text></text>
> </blameline>

wold be:
<blameline
     revision="52"
     author="julianfoad"
     date="2003-11-27T00:24:15.385454Z"><![CDATA[Hello]]></blameline>

<blameline
     revision="61"
     author="julianfoad"
     date="2004-03-20T00:44:03.836506Z"/>

Laszlo Kishalmi

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jan 14 19:39:41 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.