On Thu, Aug 17, 2000 at 05:30:32PM -0000, [EMAIL PROTECTED] wrote:
> Hi, I am new to CVS and I use WinCVS as the front end on a local 
> repository.  I have a module with a main trunk.  There is a branch 
> off that trunk that I use as experiment code.  Is there a way to 
> merge the lastest changes on the main trunk to the branch code?  I 
> don't want the experiment code to affect the main trunk.  I only 
> found instruction for the other way around.  Thanks.

It's pretty much the same method, actually.  Think of merging not so much
as bringing two points together but, instead, taking the differences
between any two arbitrary points in the system, and applying those same
changes to your current code.

If you've played in the unix world a lot, and used to people throwing
around patches, it works just like that.

Sometimes I find it conceptually easier to think of the process as 1) doing
a diff between two versions, 2) applying that diff as a patch to the
current version.

Actually, there was one time where I actually had to do that because CVS
couldn't handle the merge itself, so I had to use Larry Wall's actual patch
program to apply it.

Anyway, obviously it tends to only make sense to generate diff/patch from
two version on the same branch.  But you can, in general, apply that patch
to any branch you want.

So, for your situation, yuou have something like this:
 
Branch point
     v
0----+--------  Main
     |
     +-------   Test

Now, hopefully you labled the branch point with something when you created
the branch.  Otherwise, this is a pain.

I will assume that the regular tag is called test_bp, and the branch tag is
called test.

First, get onto the main branch:

cvs up -A

Tag the current versions:

cvs tag merge_to_test_1

Now, onto the test branch:

cvs up -r test

Now merge:

cvs up -j test_bp -j merge_to_test_1

validate, then commit:

cvs commit -m "merged in changes from test_bp to merge_to_test_1"


Now, the reason for using test_1 is so, later on, when you want to do that
again, you would do:

cvs up -A
cvs tag merge_to_test_2
cvs up -r test
cvs up -j merge_to_test_1 -j merge_to_test_2
cvs commit -m "merged in changes from merge_to_test_1 to merge_to_test_2"

Hope that helps!
mrc
-- 
       Mike Castle       Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
    We are all of us living in the shadow of Manhattan.  -- Watchmen

Reply via email to