CVS - A cool topic...

Kevin Buettner plug-discuss@lists.PLUG.phoenix.az.us
Wed, 25 Jul 2001 12:09:54 -0700


On Jul 25, 10:38am, Kurt Granroth wrote:

> >     3) How to automatically commit the same patch to multiple
> >        repositories (or branches).  (This is something that I
> >        presently do manually, but I'd love to hear about a way
> >        to automate it.)
> 
> Dunno.  I'd probably just hack up a shell script to automate this if I ever 
> needed to.

I'm always worried about conflicts.  The patch in question might not
always apply cleanly.  Even if it does, I feel better about the whole
thing if I eyeball it first.

> >     4) How do you diff between two different dates on a branch?
> >        (Actually, I don't think this used to be possible, but it
> >        might be now...)
> 
> cvs diff -D "First Date" -D "Second Date" file

That does it on the head.  I want the same functionality on a branch.
I.e, something like:

    cvs diff -r branchname -D "First Date" -D "Second Date" file

But, to the best of my knowledge, this doesn't work.  (Actually, I
received some mail from Karl Fogel recently indicating that this
problem might have been fixed.)

> >     5) How do you rename files and directories AND preserve the
> >        history, tags, etc. associated with the original files?
> >        (I know of a way to do it, but it isn't pretty.)
> 
> Log on to the server and change the directories and ,v files there.  Not 
> pretty, but we've done it quite a few times and haven't had any problems.

For a long time, that's what I thought too.  But it's not that simple.
If you have branches, or even just tags on the main branch, you'll
get the wrong set of files when you check something out via one of
these tags.

In order to rename a file, you have to do something like this:

    1) Log on to the server and MAKE A COPY of the file you wish
       to rename.  I.e, assuming that you're renaming foo.c to bar.c,
       you'd do:

	   cp foo.c,v bar.c,v

    2) Edit the new ,v file and remove all (?) of the old tag information.
       After all, if someone checks out something old, they don't want
       this file in what they've checked out.

    3) From a checked out directory, do a "cvs rm foo.c" and then
       commit this change.  This will place foo.c in the Attic so
       that it will still be found when checking out old branches
       or tags.  However, because it's in the Attic, it won't be
       found any longer when you check out the HEAD.

It'd probably be possible to write a script which would automate all of
this.  But, if it's scriptable, there's really no reason for CVS to not
have this functionality builtin.

Kevin