[cvsnt] Ann: XML schema for cvs log output

Kari Hoijarvi hoijarvi at me.wustl.edu
Tue Apr 15 15:21:02 BST 2003


I never meant the server to use XML inside the server
or between the commands. The protocols should stay just
as they are.

What I'm talking about, is a command line option, that allows
the output of the command to be XML.

My current python scripts typically start something like:

    inpipe, outpipe = os.popen4('cvs update')
    line = outpipe.readline()
    while line:
        line = line.rstrip()
        print line
        if line == "":
            pass
        elif line[0:2] == "? ": # this file is not in CVS
            file = line[2:]
	#etc.....

This is ugly code, that mixes parsing and processing together.
I wanted to separate those two, but I could never justify
it time wise.

It would be much nicer to write instead

    inpipe, outpipe = os.popen4('cvs -xml_output update')

and direct the output to an XML reader.

A possible way to do this is to parse the current output
and to generate XML out of it. This would have the
advantage, that any cvs implementation would work, but
on the other hand, it would be limited to the library
platform, like python or COM.

Another is to change the code that writes this output
and make it to emit XML. I cannot see, how this could
be more difficult that the first option. It requires
changes to the code, but on the other hand, every change
would first test if the flag -xml_output is in place,
so the chances of introducing bugs would be small.

CVS output is easy to parse. If XML was just a file
format, I would not be so keen on it. But it's the schema
that I'm currently taking advantage of. Besides validation,
I use them for SQL-XML mapping and especially user
interface generation.

Kari


-----Original Message-----
From: cvsnt-bounces at cvsnt.org [mailto:cvsnt-bounces at cvsnt.org]On Behalf
Of Tony Hoyle
Sent: 15 April 2003 08:36
To: cvsnt at cvsnt.org
Subject: Re: [cvsnt] Ann: XML schema for cvs log output


On Tue, 15 Apr 2003 07:45:07 -0500, "Kari Hoijarvi" <hoijarvi at me.wustl.edu>
wrote:

>It indeed could be nice, if you didn't have to parse the
>CVSNT output. Adding XML output option is probably less
>work than writing a parser to do it.
>
You *have* to be joking.  I estimate 3-6 months work to make a server that
uses XML, and it would be completely incompatible with all other CVS servers
(so nobody would use it anyway).

I really don't understand why anyone would want an XML version anyway (and
not
to be too harsh, spending 10 seconds sticking tags around every word in the
output from 'cvs log' does *not* constitute an XML schema) - the
client/server
protocol is well defined and easy to parse.

Tony

_______________________________________________
cvsnt mailing list
cvsnt at cvsnt.org
http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt



More information about the cvsnt mailing list