merging main trunk to branch?
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.
Re: merging main trunk to branch?
On Thu, Aug 17, 2000 at 05:30:32PM -, [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
Re: merging main trunk to branch?
Mike Castle wrote: 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. (Allow me to advertise my patch again) My patch will alleviate some of this pain, (though my patch may imply some changes that need to be made to wincvs or other cvs clients besides the command line cvs client, specifically in the area of allowing "cvs add" to work with the ".trunk" tag.) http://www.geocities.com/dotslashstar/branch_patch.html Then you could merge from trunk to branch "foo" like this, using the ".trunk" and "branchname.origin" pseudo tags that the patch implements. cvs rtag -r .trunk trunk_merge_point modulename cvs co -r foo modulename cd modulename cvs update -j foo.origin -j trunk_merge_point cvs commit cvs tag foo_post_trunk_merge -- steve __ Do You Yahoo!? Send instant messages get email alerts with Yahoo! Messenger. http://im.yahoo.com/
Re: merging main trunk to branch?
One of the tricks I sometimes use, to avoid having to keep track of branch points, is to only merge from any given branch once. Thus, in this case, I would create branch2 from the main trunk and merge the changes from the first branch forward onto the new branch. cvs up -A# get the main trunk cvs tag -b test2 cvs up -rtest2 -jtest And use test2 from now on. By doing that, though, you will lose access to CVS's ability to organize log messages along a single development path by keeping them on a single branch. Derek -- Derek Price CVS Solutions Architect ( http://CVSHome.org ) mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com ) Mike Castle wrote: On Thu, Aug 17, 2000 at 05:30:32PM -, [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
Re: merging main trunk to branch?
Again, I think my "get date from file" patch would help here. Do -jbranch:date:.last right?