[oclug] complicated CVS setup

Dan York dyork at e-smith.com
Fri Apr 27 09:30:33 EDT 2001


Brenda and David,

> > > > Ideally I want the user to be forced to update, recompile, test, then
> > > > commit.  However I know I cannot force them to do the compile/test steps
> ...
> > > CVS will not let you commit without updating, so I don't see the purpose
> > > of this.
> > 
> > I want to force people to test before they commit.  And what is the point
> > of testing if you don't have the latest files in the project.
> 
> David was trying to say that cvs's default behaviour already
> does what you want.  See the following paragraph from the man page:

I sent the same thing to Bart when he first posted his message, but then I
understood his larger point.  Yes, CVS will make sure the file is up-to-date
during the commit.  When I do a commit, either of two things will happen:

  1. If there are no conflicts between the changes made locally and the
     version in the repository, the changes will be merged into the repository
     and the updated (and merged) copy will be downloaded to my local
     working copy.

  2. If there ARE conflicts, cvs will give me an error saying that my working
     copy is not up-to-date and that I need to do a 'cvs update' first.

So it will catch it.  But Bart is concerned about the "automagic" part of
case #1.

Say I have some code that looks like:

     if x < 5:
         print "This is some text"

Now, I don't like that bogus text message, so I change my local copy to:

     if x < 5:
         print "The value is less than 5."

Unknown to me, though, some other developer has changed the code and committed
their changes to the repository. The code now reads:

     if x < 100:
         print "This is some text"

But I don't know that because I haven't done a 'cvs update' lately.  So I just
go and commit my changes.  CVS examines the code and determines that my
changes don't conflict with anyone else's, so it merges the code very nicely
and the result is:

     if x < 100:
         print "The value is less than 5."

which is clearly not correct if x is 5 or greater.

If I had done a 'cvs update' before committing, and then had examined the
changes or done the appropriate testing, I would have caught the error and
been able to change my text message (or the test). 

So Bart wants to force his developers to be sure that they have the latest
code and have tested with the latest code before they commit their changes.
That is my understanding.  Do I have it correct, Bart?

Dan





More information about the OCLUG mailing list