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

Re: bad output format design issue: svn log -v format is not parseable :-(

From: C.A.T.Magic <c.a.t.magic_at_gmx.at>
Date: 2004-04-04 00:40:04 CEST

Edmund Horner wrote:

> Hash: SHA1
> C.A.T.Magic wrote:
> | how can I tell, by looking at the output
> | A \branches\release-0.28.0 (from \trunk:6846)
> | if this means the filename
> | "\branches\release-0.28.0 (from \trunk:6846)"
> | or the file
> | "\branches\release-0.28.0"
> | ???
> | this is evil!
> What about "svn log --xml" ? Hopefully it should output something that
> is unambiguously machine readable (though requiring an XML parser, of
> course).

as far as i can see it the XML output has similar issues:
space characters are not escaped and the filenames are
not defined as string attributes but just as plaintext
between tags.
afaik, most XML parsers collapse multiple spaces into a
single space.

when i look at the xml with an xml-viewer the SVN output
      action="A">/trunk/ a file with 2 spaces</path>
displays as
   <path action="A">/trunk/ a file with 2 spaces</path>

but i also tried it with the ruby-xml parser
and the parsed string was correct
   ( "/trunk/ a file with 2 spaces" )

i'm not sure what the xml standard defines
for multiple spaces in this case or how other xml
parsers handle this.

i noticed that other characters are escaped,
for example semicolons ';' are handled,
umlauts '' remain as utf-8.
      action="A">/trunk/a&amp;b-;2 3.txt</path>

but even IF i could use --xml for svn log,
there are several other commands
which fail in the same way:
  svn status -v
                 8 8 cat release-0.28.0 (from trunk6846)
                11 11 cat a file with spaces
                10 10 cat a&b-;2 3.txt
                12 12 administrator johnMyFile.c
                12 12 administrator johnMy spaced File.c

and these commands cannot output xml.
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Apr 4 00:40:14 2004

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.