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

Re: programmatic access to svn

From: Andy Levy <andy.levy_at_gmail.com>
Date: Tue, 5 Apr 2011 11:33:31 -0400

On Tue, Apr 5, 2011 at 10:59, <dov.kruger_at_americas.bnpparibas.com> wrote:
>
> Hello,
>
> I am trying to write a couple of quick scripts to help migrate us to svn
> from cvs and to help display statistics about our new svn codebase.
>
> We're running on a Red Hat enterprise 5 Linux, with all the usual utilities,
> and svn 1.6.15
>
> First, if we simply migrate to cvs we will lose the history of what we
> currently have in cvs.  I was hoping to retrieve each diff from cvs, apply
> it, and check it into cvs.
> Before even attempting to write something, I wondered whether anyone here
> already has such a thing.  This seems like a wonderful utility to have,
> since it would naturally encourage people to make the switch.

Google cvs2svn

> For cvs, I can use the command:
>
> cvs history  -a -c
>
> to generate me a list of all changes to the archive, the date, the user who
> applied it, the file, and the directory it was in.
> 1. I don't have access to the svn machine itself, and svnadmin does not
> accept a URL.  I'm not looking for write access, just to be able to read and
> gather statistics.
> Is there any way out?  Can I copy the svn archive locally and then do the
> work, or do I need access to the machine?

History is not usually accessed via svnadmin at all, it's done via a
Subversion client. Start with svn log --verbose. It even can produce
XML output (--xml) if you find processing XML easier.

> 2. What is the analogous command to get me a list of svn modifications?
>
> I'm looking for the ability to extract all changes sequentially from a svn
> archive for analysis
>
> On page 299 of the manual I can see the command
> svnadmin dump /var/svn/repos -r 21 --incremental > incr.dump
>
> This seems like what I would need to pull out each change, and I could
> increment from rev 1 to the maximum number.  Is this the best way, or is
> there some other approach?

Again, you shouldn't need anything more than a Subversion client to
look at each change. I'm not sure what exactly you're attempting to do
here, but svn diff should be able to handle it, perhaps with some
scripting around it.

> Last, since presumably advanced svn users might know cvs from before, what
> would the equivalent command in cvs?  Is it:
>
> cvs diff -r rev1 -r rev2 file
>
>
> Last, if I wanted to programmatically take each change in cvs and enter it
> in svn going back 6 months, the script would need to be able to insert as
> the individual user.  Is there any way of bypassing security in svn itself,
> or do I have to su each user and run the given commit?  I can see doing that
> as root, but if there's a cleaner way....

Again, cvs2svn, then apply the result of that to your repository. But
really, you should only need to do this once - when you cut off write
access to cvs, then convert the repository & load it into Subversion.
Received on 2011-04-05 17:34:54 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.