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

Re: Incomplete xml output when using --xml to non-existent server

From: Branko Čibej <brane_at_apache.org>
Date: Wed, 2 Mar 2016 19:07:33 +0100

On 02.03.2016 15:05, Johan Corveleyn wrote:
> Hi all,
>
> A colleague of mine ran into this, and I'm wondering if it's expected
> behavior or a bug:
>
> For certain commands with the --xml option, the xml output is
> incomplete when sending the request to a non-existent server. This can
> cause an issue for tools that try to parse the output into some data
> structure, and expect correct XML (even though the command has exited
> with an error).
>
> For instance, 'svn info' and 'svn ls' behave thusly (maybe other
> commands as well):
>
> [[[
> C:\>svn info --xml https://nonexistent/svn
> <?xml version="1.0" encoding="UTF-8"?>
> <info>
> svn: E170013: Unable to connect to a repository at URL 'https://nonexistent/svn'
> svn: E731001: No such host is known.
>
> C:\>svn ls --xml https://nonexistent/svn
> <?xml version="1.0" encoding="UTF-8"?>
> <lists>
> <list
> path="https://nonexistent/svn">
> svn: E170013: Unable to connect to a repository at URL 'https://nonexistent/svn'
> svn: E731001: No such host is known.
> ]]]
>
> (The 'svn: Exxx' warnings are printed to stderr, while the incomplete
> xml output is printed to stdout)

This is clearly a bug; stdout should be either empty, or valid XML.

In this case I suspect that we're printing the generic XML header too soon.

-- Brane
Received on 2016-03-02 19:07:42 CET

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.