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

Re: [PATCH] Do 'svn log --xml --incremental'

From: Nuutti Kotivuori <naked_at_iki.fi>
Date: 2002-10-29 22:54:17 CET

Karl Fogel wrote:
> If you run plain 'svn log' without --incremental' its output is
> still suitable to for concatenation with incremental output later
> on. For example:
>
> $ svn log -r X:Y > foo
> $ svn log --incremental -r (Y+1):Z > bar; cat foo >> bar
>
> where usually X < Y < Z.

Well, yes - but what this means is that you can prepend to a
non-incremental log invocation, but you can't append to it. I think
that's a bit weird - I would expect that you can append an incremental
log to a normal log, but not prepend. Perhaps the incremental option
should suppress the beginning separator, not the ending? Anyway, this
is a different discussion.

> But with the xml output, if you didn't use --incremental the first
> time, then using it the second time will result in an strange xml
> document, because it will have some log data inside the overall log
> element, and some outside it.

True - but I'm not entirely sure that's really a reasonable assumption
in any case. If you take a well-formed XML document and concatenate
anything with it, the result is no longer well-formed (unless ofcourse
you concatenated just whitespace or something similar). Simple textual
concatenation in XML terms isn't a terribly relevant operation.

> This isn't a fatal flaw, just something that maybe should be
> documented somewhere, I guess (?). People doing xml logs will need
> to always pass the --incremental flag, or do some manual cutting, I
> think.

Well depends a bit on what you want and what you mean by manual
cutting.

Concatenating several 'svn log --xml --incremental' invocations is not
going to give you a well-formed document either. It lacks the XML
declaration and the document would have several root elements, where
as only one is allowed.

On the other hand - doing an XML aware concatenation usually means
just adding the elements to be concatenated inside the root element at
end. This works perfectly with the incremental option.

But what this really boils down to, in my opinion, is that the
'--incremental' option name is misleading. In the XML case, better
option names might be '--well-formed', '--xml-snippet',
'--element-only', and so on. Especially with the help message being:

  --incremental : give output suitable for concatenation

However, I am pretty convinced that desired behavior for the XML
output is indeed this.

> Anyway, +1 on the patch, with or without more documentation.

Thanks, committed.

I'll probably be revising this thing when a cleanup is done on the XML
output format (and a DTD is made for it) - currently it's pretty
suboptimal, especially on the changed paths section.

-- Naked

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 29 22:55:23 2002

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.