info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Merge question


From: Christopher.Fouts
Subject: RE: Merge question
Date: Wed, 26 Jan 2005 12:34:38 -0500

I understand "perfectly" what the cvs command I outlined does.
I just didn't know if there are options to modify the behavior.
Let me explain.

In my group of 4 developers, I've implemented a multi-branch
integration strategy, where each developer has a branch off the
trunk. Each developer then does his work on his branch. This
strategy works for me, but may not work for everybody.

For simplicity, take just 2 users, userA and userB with their
respective branchA and branchB.

So to integrate, userB submits his changes to the trunk correct?
This may include "new" files/dirs that userA does NOT have yet.
For userA to pick up these changes, he has to do a 

        > cvs up -j branchA -j HEAD proj

on his current directory structure based on his branchA correct? 
There in-lies the problem...

-chris

>-----Original Message-----
>From: address@hidden 
>[mailto:address@hidden
>] On Behalf Of Jim.Hyslop
>Sent: Wednesday, January 26, 2005 12:18 PM
>To: address@hidden
>Subject: RE: Merge question 
>
>
>Chris Fouts wrote:
>> When merging 2 branches, say HEAD to branchB, where
>> branchB contains files NOT YET in HEAD, the branchA
>> files get "deleted." Any way to prevent this?
>> 
>>      > cvs up <options???> -j branchA -j HEAD proj
>This tells CVS "Take the difference between the tip of branchA 
>and the tip of the trunk, and apply them to the current 
>directory." That is most likely
>*not* what you want - this will make the current directory 
>identical to the trunk (which is why your files keep disappearing ;-)
>
>> IOW, what options do I need?
>You have all the options you need, you just need to get the 
>right ones and in the right order.
>
>I'm not clear on exactly what you're trying to do - don't 
>think of this as "merging two branches", but rather as 
>"merging the changes from one branch into another." So, with 
>that in mind, I will assume you meant "merging the changes 
>from the HEAD into the branch". The command is simply:
>
>cvs update -j HEAD
>
>Note that if you plan to do more than one merge, then you 
>really need to apply a tag at the last merge point:
>
>cvs update -j HEAD
>cvs tag -r HEAD last-head-merge
>
>Then, the next time you update, you use that tag and HEAD:
>
>cvs update -j last-head-merge -j HEAD
>cvs tag -F -r HEAD last-head-merge
>
>Now, you may have noticed a small race condition: if someone 
>checks something into HEAD between the 'update' and the 'tag' 
>commands, then the version you merged will *not* be the 
>version you just tagged. To avoid that problem, use a 
>temporary tag; the complete sequence, each time you merge, is
>now:
>
>cvs tag -rHEAD tmp-tag-head-merge
>cvs up -j last-head-merge -j tmp-tag-head-merge
>cvs tag -F -r tmp-tag-head-merge last-head-merge
>cvs tag -d tmp-tag-head-merge
>
>Note: prior to the first merge, you'll have to apply the tag 
>last-head-merge to the branch point.
>
>Merging from the branch to the trunk is handled similarly - 
>just change all occurrences of 'head' or 'HEAD' to the branch tag.
>
>-- 
>Jim Hyslop
>Senior Software Designer
>Leitch Technology International Inc. ( http://www.leitch.com ) 
>Columnist, C/C++ Users Journal ( http://www.cuj.com/experts )
>
>
>_______________________________________________
>Info-cvs mailing list
>address@hidden
>http://lists.gnu.org/mailman/listinfo/info-cvs
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]