On Thu, Mar 3, 2016 at 3:42 PM, Johan Corveleyn <jcorvel_at_gmail.com> wrote:
> On Thu, Mar 3, 2016 at 3:11 PM, Vincent Lefevre <vincent-svn_at_vinc17.net> wrote:
>> On 2016-03-03 10:31:52 +0100, Johan Corveleyn wrote:
>>> No, of course not :-). I just gave an example where the output was
>>> broken (host not found), as opposed to another error condition (server
>>> reponds "URL 'X' non-existent in revision Y") where the xml response
>>> is still valid. Ignoring implementation (which I always do when I'm
>>> arguing about behavior), this seems quite weird to me.
>>
>> No, this is different. In the former case, this is a server or
>> communication problem: it is not possible to output the info
>> because it is not possible to know what it is. In the latter case,
>> the communication is successful, so that it is possible to output
>> the info.
>
> Agreed, it's different. But it's still weird / inconsistent IMO.
>
> As I said, I don't know anything about the implementation of --xml,
> but it seems to me that svn could easily complete the output by
> closing the root element with "</info>". Apparently *something* goes
> wrong executing the info request ... let's just cleanup nicely.
>
> Another example, no server communication needed:
>
> [[[
> C:\>svn info --xml .
> <?xml version="1.0" encoding="UTF-8"?>
> <info>
> svn: E155007: 'C:\' is not a working copy
>
> ]]]
>
>
> But, go inside a working copy, and use a non-existing path:
>
> [[[
> C:\WorkingCopy>svn info --xml blah
> <?xml version="1.0" encoding="UTF-8"?>
> <info>
> svn: warning: W155010: The node 'C:\WorkingCopy\blah' was not found.
>
> </info>
> svn: E200009: Could not display info for all targets because some
> targets don't exist
>
> ]]]
>
>
> Why </info> in one case and not in the other? As a user, I see no
> reason for that.
Okay, continuing to look at svn like a black box, I'm seeing a pattern here:
- If a warning occurs ("svn: warning: W..."), it seems to be
non-fatal, and processing continues, eventually closing the xml
element.
- If an error occurs ("svn: E...."), it seems to be fatal immediately,
processing stops, and the xml element is not closed.
Incidentally, this also yields other interesting behavior, when using
multiple targets: if one of the targets gives a *warning*, svn happily
continues to do its thing for the remaining targets. If one of the
targets gives an *error* the output stops abruptly and further targets
are no longer processed. This difference in behaviour is also visible
with non-xml output (but as I said, with xml output the result is
invalid xml, which makes it a bit "stranger" :-)).
[[[
### Error "not a working copy": processing stops immediately
C:\Temp\svntest>svnadmin create repos
C:\Temp\svntest>svn co file:///c:/temp/svntest/repos wc
Checked out revision 0.
C:\Temp\svntest>svn info . wc
svn: E155007: 'C:\Temp\svntest' is not a working copy
C:\Temp\svntest>svn info wc .
Path: wc
Working Copy Root Path: C:\Temp\svntest\wc
URL: file:///C:/temp/svntest/repos
Relative URL: ^/
Repository Root: file:///C:/temp/svntest/repos
Repository UUID: c5f9bc8f-ca83-b94e-94c2-b2c1b76f1aee
Revision: 0
Node Kind: directory
Schedule: normal
Last Changed Rev: 0
Last Changed Date: 2016-03-10 14:25:10 +0100 (do, 10 mrt 2016)
svn: E155007: 'C:\Temp\svntest' is not a working copy
C:\Temp\svntest>svn info --xml . wc
<?xml version="1.0" encoding="UTF-8"?>
<info>
svn: E155007: 'C:\Temp\svntest' is not a working copy
### Warning "node was not found": non-fatal
C:\Temp\svntest>cd wc
C:\Temp\svntest\wc>svn info . bla
Path: .
Working Copy Root Path: C:\Temp\svntest\wc
URL: file:///C:/temp/svntest/repos
Relative URL: ^/
Repository Root: file:///C:/temp/svntest/repos
Repository UUID: c5f9bc8f-ca83-b94e-94c2-b2c1b76f1aee
Revision: 0
Node Kind: directory
Schedule: normal
Last Changed Rev: 0
Last Changed Date: 2016-03-10 14:25:10 +0100 (do, 10 mrt 2016)
svn: warning: W155010: The node 'C:\Temp\svntest\wc\bla' was not found.
svn: E200009: Could not display info for all targets because some
targets don't exist
C:\Temp\svntest\wc>svn info bla .
svn: warning: W155010: The node 'C:\Temp\svntest\wc\bla' was not found.
Path: .
Working Copy Root Path: C:\Temp\svntest\wc
URL: file:///C:/temp/svntest/repos
Relative URL: ^/
Repository Root: file:///C:/temp/svntest/repos
Repository UUID: c5f9bc8f-ca83-b94e-94c2-b2c1b76f1aee
Revision: 0
Node Kind: directory
Schedule: normal
Last Changed Rev: 0
Last Changed Date: 2016-03-10 14:25:10 +0100 (do, 10 mrt 2016)
svn: E200009: Could not display info for all targets because some
targets don't exist
C:\Temp\svntest\wc>svn info --xml bla .
<?xml version="1.0" encoding="UTF-8"?>
<info>
svn: warning: W155010: The node 'C:\Temp\svntest\wc\bla' was not found.
<entry
kind="dir"
path="."
revision="0">
<url>file:///C:/temp/svntest/repos</url>
<relative-url>^/</relative-url>
<repository>
<root>file:///C:/temp/svntest/repos</root>
<uuid>c5f9bc8f-ca83-b94e-94c2-b2c1b76f1aee</uuid>
</repository>
<wc-info>
<wcroot-abspath>C:/Temp/svntest/wc</wcroot-abspath>
<schedule>normal</schedule>
<depth>infinity</depth>
</wc-info>
<commit
revision="0">
<date>2016-03-10T13:25:10.644866Z</date>
</commit>
</entry>
</info>
svn: E200009: Could not display info for all targets because some
targets don't exist
]]]
Interesting ...
It pops up some additional questions:
- When is something a warning and when is it an error?
- Why stop for an error, and not for a warning?
--
Johan
Received on 2016-03-10 14:33:44 CET