You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Bernhard Merkle <be...@googlemail.com> on 2008/07/29 05:44:44 UTC

invalid XML with svn log --xml

Hi,

I think the following is a bug or feature with SVN 1.5 svn log --xml

The problem is that svn log --xml _partly_ emits xml in case of an error.

1. checkout with SVN 1.5
2. do a svn log --xml with SVN 1.4.6.
3. I know that the WC format had changed and this is an "invalid" operation,
but look at the error msg below:
It starts with putting out _some_ XML and then the error msgs, and then the
XML is not valid </log>

IMO, there should be NO xml at all in the case of an error. Better only
issue the error msgs.
Seems that starting the output is done _before_ the actual error checking...

thanks,
Bernhard.


C:\wcWith1.5SVNformat>c:\tools\bin32\Subversion1.4.6\bin\svn log
--non-interactive --xml -v
<?xml version="1.0"?>
<log>
svn: Der Client ist zu alt, um mit der Arbeitskopie ».« zusammen zu
arbeiten;
bitte besorgen Sie einen neueren Subversion-Client

Re: invalid XML with svn log --xml

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Bernhard Merkle wrote:
> Hi,
> 
> I think the following is a bug or feature with SVN 1.5 svn log --xml
> 
> The problem is that svn log --xml _partly_ emits xml in case of an error.
> 
> 1. checkout with SVN 1.5
> 2. do a svn log --xml with SVN 1.4.6.
> 3. I know that the WC format had changed and this is an "invalid" operation,
> but look at the error msg below:
> It starts with putting out _some_ XML and then the error msgs, and then the
> XML is not valid </log>
> 
> IMO, there should be NO xml at all in the case of an error. Better only
> issue the error msgs.
> Seems that starting the output is done _before_ the actual error checking...

That's exactly right.  Logs (and lots of other data in Subversion) are returned 
"streamily," meaning they are returned one at a time as they are found.  Instead 
of waiting for all the messages to be returned, the client outputs them 
immediately as well, keeping memory use to a minimum.

I agree that it would be nice if --xml really meant XML output, even in the case 
of an error, but checking for all errors before doing any output would lead to 
an inefficient use of system resources, and also a perceived lack of output 
while the logs were being retrieved.  Both ideas are not viewed favorably by the 
developers.  However, it may be possible to improve the situation for some 
classes of errors.

> C:\wcWith1.5SVNformat>c:\tools\bin32\Subversion1.4.6\bin\svn log
> --non-interactive --xml -v
> <?xml version="1.0"?>
> <log>
> svn: Der Client ist zu alt, um mit der Arbeitskopie ».« zusammen zu
> arbeiten;
> bitte besorgen Sie einen neueren Subversion-Client

In this case, the error is being printed on stderr, and the xml on stdout.  It 
should not be difficult to separate the two.

-Hyrum


Re: invalid XML with svn log --xml

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Ryan Schmidt wrote:
> 
> On Jul 29, 2008, at 00:44, Bernhard Merkle wrote:
> 
>> I think the following is a bug or feature with SVN 1.5 svn log --xml
>>
>> The problem is that svn log --xml _partly_ emits xml in case of an error.
>>
>> 1. checkout with SVN 1.5
>> 2. do a svn log --xml with SVN 1.4.6.
>> 3. I know that the WC format had changed and this is an "invalid" 
>> operation, but look at the error msg below:
>> It starts with putting out _some_ XML and then the error msgs, and 
>> then the XML is not valid </log>
>>
>> IMO, there should be NO xml at all in the case of an error. Better 
>> only issue the error msgs.
>> Seems that starting the output is done _before_ the actual error 
>> checking...
>>
>> thanks,
>> Bernhard.
>>
>>
>> C:\wcWith1.5SVNformat>c:\tools\bin32\Subversion1.4.6\bin\svn log 
>> --non-interactive --xml -v
>> <?xml version="1.0"?>
>> <log>
>> svn: Der Client ist zu alt, um mit der Arbeitskopie ».« zusammen zu 
>> arbeiten;
>> bitte besorgen Sie einen neueren Subversion-Client
> 
> 
> Subversion 1.5.1 includes some fixes to "svn log --xml". See the 1.5.1 
> CHANGES file, which says, in part:
> 
>   * fixed: invalid XML from 'svn log --xml' against pre-1.2 servers 
> (r31875)
> 
> http://svn.collab.net/repos/svn/tags/1.5.1/CHANGES
> 
> So maybe this addresses your concern.

Nah, this was a regression against 1.4.x which cause 1.5.0 to print an extra 
</log> tag when running against pre-1.2 dav servers.  (Why anybody is still 
running a pre-1.2 server is beyond me...)

-Hyrum


Re: invalid XML with svn log --xml

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jul 29, 2008, at 00:44, Bernhard Merkle wrote:

> I think the following is a bug or feature with SVN 1.5 svn log --xml
>
> The problem is that svn log --xml _partly_ emits xml in case of an  
> error.
>
> 1. checkout with SVN 1.5
> 2. do a svn log --xml with SVN 1.4.6.
> 3. I know that the WC format had changed and this is an "invalid"  
> operation, but look at the error msg below:
> It starts with putting out _some_ XML and then the error msgs, and  
> then the XML is not valid </log>
>
> IMO, there should be NO xml at all in the case of an error. Better  
> only issue the error msgs.
> Seems that starting the output is done _before_ the actual error  
> checking...
>
> thanks,
> Bernhard.
>
>
> C:\wcWith1.5SVNformat>c:\tools\bin32\Subversion1.4.6\bin\svn log -- 
> non-interactive --xml -v
> <?xml version="1.0"?>
> <log>
> svn: Der Client ist zu alt, um mit der Arbeitskopie ».« zusammen zu  
> arbeiten;
> bitte besorgen Sie einen neueren Subversion-Client


Subversion 1.5.1 includes some fixes to "svn log --xml". See the  
1.5.1 CHANGES file, which says, in part:

   * fixed: invalid XML from 'svn log --xml' against pre-1.2 servers  
(r31875)

http://svn.collab.net/repos/svn/tags/1.5.1/CHANGES

So maybe this addresses your concern.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org