CVS Copies Done By Anyone

One of the pepertual problems of CVS is that it doesn’t allow for versioned copies of files from one place to another while preserving important history/blame data. This has traditionally been solved in Mozilla by performing copies of the RCS files on the CVS server. This is not an ideal solution for various reasons, but most painfully because it requires the physical presence of a CVS sysadmin, whose time is at a premium.

In a previous life, Schrep wrote a script that would emulate a server-side CVS copy using only client-side commands: each revision of the old file would be incrementally committed to the new location with information about the original commit time/date/author. Unfortunately, that script got lost in the sands of time: fortunately, I have found time to recreate the script. It is now possible to perform cvs copies entirely from the client side, without any special CVS permission.

The script takes as input a .cvsmoves file, of the form Mozilla already uses for server-side copies. See this attachment for the real-world example that I was using for testing.

This script is STILL BETA, and MOSTLY UNTESTED. Please don’t use it in real-world situations yet without testing the process very thoroughly first!

http://svn.smedbergs.us/commit-cvs-copy/commit-cvs-copy

Atom Feed for Comments 4 Responses to “CVS Copies Done By Anyone”

  1. Laurentj Says:

    What about a migration to subversion ? Subversion fixes many CVS issues (and particularly, this one you talk about)… I know this is a big work, but i think it could bring many advantages (and one of them : better access to the repository…)

  2. Joseph Says:

    If you switch from CVS you might as well go all the way to a distributed system like Git, Mercurial, or Bazaar-NG.

  3. db48x Says:

    Very cool. Now I just need a spare repository to try it out on…

  4. Sascha Says:

    Laurentj, Mozilla uses branches and tags very heavily. Also, many developers are Unix guys, so the quality of the command-line client is very important.

    Having said that, svn totally sucks at doing the former with the latter. Want proof?

    For example, comparing the local foo.c with another branch in cvs:

    $ cvs di -r REV1 foo.c

    Easy and quickly to write manually. Now the same in svn:

    $ svn diff svn://some-cvs.some-org.com/module/branches/REV1 foo.c

    Notice the difference? You could also try comparing two branches:

    $ svn diff svn://some-cvs.some-org.com/module/branches/REV1 svn://some-cvs.some-org.com/module/branches/REV2 foo.c

    Oh, the joy! Obviously, whoever came up with that syntax in svn must be a (careful, insult ahead) total braindead moron.

Leave a Reply