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

Re: cvs2svn: raw or cooked?

From: Bob Miller <kbob_at_jogger-egg.com>
Date: 2000-09-27 02:02:06 CEST

Greg Stein wrote:

> I've got a Python script that pulls apart a ,v file, and Jay Painter has
> been threatening to write one in C. These are BSD licensed.

I dug around on CPAN this morning and found the Rcs module. Among
other things, it parses an RCS file. There's no license mentioned in
the module, so I'll contact the author and see if he'll let us use it.

> But given that Bob has already written a bunch of Perl, I don't see
> that the Python code will be too handy :-)

Hey, I really do want to learn Python. I'm always looking for better
tools (hence my interest in this project (-: ). But not this week.
Next week, for sure. (-:

> btw, I agree with Jim: crawl the ,v files to get all the data; using
> cvs commands just doesn't feel right and it doesn't seem like you
> could really get at all the data. (but I'll admit I don't know that
> for sure)

Two strikes against parsing "cvs log" output:

        1. doesn't handle the Attic.

        2. potential ambiguity if a log message's contents look like a
           log message delimiter.

One strike against parsing RCS files directly:

        1. can't access remote CVS repository.

My current approach is to do both ( :-) ), but I'm parsing RCS first.

> It might also be nice to take this moment to define the XML interchange
> format for an SVN repository. If the tool was cvs2xml, then we
> could do "svn import-xml my-cvs-repository.xml". And anybody could do "svn
> export-xml ..." followed by an svn import-xml somewhere else.
>
> Just to make your job harder... :-)

No, that makes it easier. I was going to define a serial
representation of the info I collect out of CVS and write a program to
read that rep. and call libsvn_fs routines. If the serial format is
already defined, then that's one less step to do.

Does a program exist to read vdelta XML?

BTW, here's my status. cvs2svn.pl now can read one RCS file and build
the correct data structure. I've written the directory tree walker as
a separate program, and I need to integrate it into cvs2svn.pl, then
it's time to check it all in.

I figure my progress will basically stop for a couple of days while I
figure out how to actually USE cvs to check files in, at the same time
I figure out how to bludgeon automake et al into cooperation.

Karl Fogel wrote:

> Note that each commit is represented by one complete <tree-delta> xml
> form. We can write up the DTD for you really quickly, it's easy.

How close is it to the DTD that Branko posted the other day? His
looked like this. (I think you missed it; it was in an attachment.)

        <?xml version="1.0" encoding="UTF-8"?>
        <!-- XML DTD for Subversion's delta packages. -->
        <!ELEMENT delta-pkg (tree-delta, text-delta*)>

        <!-- Delta types. -->
        <!ELEMENT prop-delta (set | delete)+>
        <!ELEMENT text-delta (#PCDATA)>
        <!ATTLIST text-delta
          id CDATA #IMPLIED
>
        <!ELEMENT text-delta-ref EMPTY>
        <!ATTLIST text-delta-ref
          id CDATA #REQUIRED
>
        <!ELEMENT tree-delta (add | delete | replace)+>

        <!-- Delta instructions. -->
        <!ELEMENT add (dir | file)>
        <!ATTLIST add
          name CDATA #REQUIRED
>
        <!ELEMENT delete EMPTY>
        <!ATTLIST delete
          name CDATA #REQUIRED
>
        <!ELEMENT replace (dir | file)>
        <!ATTLIST replace
          name CDATA #REQUIRED
>
        <!ELEMENT set (#PCDATA)>
        <!ATTLIST set
          name CDATA #REQUIRED
>

        <!-- Delta targets. -->
        <!ELEMENT dir ((prop-delta, tree-delta?) | (tree-delta, prop-delta?))?>
        <!ATTLIST dir
          ancestor CDATA #IMPLIED
          ver CDATA #IMPLIED
>
        <!ELEMENT file ((prop-delta, (text-delta | text-delta-ref)?) |
                        ((text-delta | text-delta-ref), prop-delta?))?>
        <!ATTLIST file
          ancestor CDATA #IMPLIED
          ver CDATA #IMPLIED
>

-- 
                                        K<bob>
kbob_at_jogger-egg.com, http://www.jogger-egg.com/
Received on Sat Oct 21 14:36:09 2006

This is an archived mail posted to the Subversion Dev mailing list.