On Sun, Mar 31, 2002 at 01:28:49PM -0700, Keith Wiley wrote:
> > If any files in the archive have changed since your last update, cvs
> > will attempt to merge the changes into your local tree.  It will attempt
> > to do this even if you've made local mods.  If it can't merge the
> > changes, it will mark the offending section of each file accordingly
> > and then you'll need to edit them by hand to resolve the conflicts.
> 
> When you say "merge into tree" does that mean the cvs update should be
> rewriting or otherwise modifying my existing personally-modified file, or
> does merge not mean that files are merged together but more that a
> separate code tree branches off and the new files reside elsewhere (and my
> modified personally-modified version of the file stays the same)?
> 
When you do a cvs update, what cvs downloads is actually a diff
between the latest version you checked out (ie, the current version
when you last did a cvs update) and the latest version in the
repository. 

When cvs sees that you've modified your local version of the file,
it does a diff between the last version you checked out and your
current copy of the file, and it compares that diff with the one it
got from the server. If the two diffs don't make any changes to the
same lines in the file, cvs simply applies the diff from the server,
and the result should merge cleanly, without any conflicts. It's
exactly the same as using patch to merge a diff into a modified file
- it looks at the contents of each hunk in the diff, and looks for 
matching lines in the file, and then applies the hunk there. If the
diffs /do/ change some of the same lines, then cvs dumps both
versions of the offending hunk to the file, roughly like this:
<<<<<< 1.26
<stuff from version 1.26>
======
<stuff from your version>
>>>>>> 

cvs will /never/ clobber your version of the file - it'll do it's
best to merge the updated version in cleanly, but if it can't it'll
give you all the information you need to do the merging yourself.

There are some gotchas about cvs use, but it's fairly sane in most
ways. And if the worst comes to the worst, you can always rename
your modified files before you do an update, and then merge your
changes by hand into the new copy cvs will make.

I'd really recommend reading the cvs info pages - they're very
informative, and quite readable. printing them out and keeping them
somewhere easily available is a good idea, too.

</lecture type="cvs"> . . .

Simon

-- 
PGP public key Id 0x144A991C, or ftp://bg77.anu.edu.au/pub/himi/himi.asc
(crappy) Homepage: http://bg77.anu.edu.au
doe #237 (see http://www.lemuria.org/DeCSS) 
My DeCSS mirror: ftp://bg77.anu.edu.au/pub/mirrors/css/ 

Attachment: msg04747/pgp00000.pgp
Description: PGP signature

Reply via email to