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

Re: ISSUE+PATCH: author & date of logentry can be empty in specific situation, problems with log.dtd & javahl

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2005-08-08 16:41:51 CEST

On Wed, 3 Aug 2005, Lieven Govaerts wrote:

> I encountered a situation this morning ( which I first mailed to the
> users-list ) in which the xml generated by svn log --xml, and more
> specific svn_client_log2, is invalid.
>
> Consequences are:
> 1. Validation of xml with the current DTD files fails.
> 2. JavaHL bindings will crash the Java VM when parsing the xml!
>
...
> But, when I request the log of this repository ( feel free to try ), I
> get:
>
> # svn log http://www.mobsol.be/svn/public
> ...
> ------------------------------------------------------------------------
> r14 | (no author) | (no date) | 1 line
>
> ------------------------------------------------------------------------
> r13 | (no author) | (no date) | 1 line
> ...
>
I'm addressing the problem of invalid XML here. As you can see from the
above, it is perfectly valid to have no author or no date (these
properties are not mandatory on a revision). I think the current DTD is
buggy in that it should leave author and date optional. I've a patch ready
that will fix this (and a bug where an empty date will cause an emtpy date
element, which I also consider as invalid even if the DTD can't validate
it.)

> The two consequenses:
> 1. When asking for XML output, this results in logentries with undefined
> author&date tags:
> ...
> <logentry
> revision="14">
> <msg></msg>
> </logentry>
> <logentry
> revision="13">
> <msg></msg>
> </logentry>
> ...
> This is not allowed according to log.dtd, so I guess this is a problem.
>
> I have no real suggestion how this should be solved since I don't know
> how handling this situation is specified.
>
ONe could argue that fixing the DTD breaks compatibility, but since that's
how the client has always behaved, it's not a problem according to me.

> 2. I made a Java application using the javahl bindings, doing the same
> log request. Both on Windows as Linux this application will crash the
> Java VM.
> LogMessage[] lms = cl.logMessages("http://www.mobsol.be/svn/public",\
> null, null);
> System.out.println(lms.toString());
> This happens in the MessageReceiver callback function in SVNClient.cpp.
>
> Attached to this mail is a patch for SVNClient.cpp. The patch makes sure
> that the date object returned to the Java client is 'null' in this
> situation, by testing specifically for that situation. Other solution
> might be to fix function svn_time_from_cstring to return NULL when date
> is NULL.
>
I know nothing about JavaHL, so I can't test the patch. By looking at it,
it seems like you introduce the same bug I'm fixing in my upcoming commit,
namely that an empty date string should be treated as no date at all. It
is strange, but it is documented in the API docs:-)

Thanks for the report,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 8 16:43:07 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.