info-cvs
[Top][All Lists]
Advanced

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

RE: Merge question


From: Jim.Hyslop
Subject: RE: Merge question
Date: Wed, 26 Jan 2005 13:41:37 -0500

> 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? 
No. As I said in my previous post, you have a "from" branch and a "to"
branch. When merging, the "to" branch must be active. Since you are merging
to the trunk, you and your developers must 'cvs update -A' before merging.

If the developer will continue to work on the branch after the merge, then
use the strategy I mentioned in my other post:
> >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

except use 'userX' instead of 'head' or 'HEAD'.

On the other hand, if the branch will no longer be used once the changes
have been merged to the trunk, then it's much simpler:
cvs update -A
cvs up -j [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 )


 
> 
> -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
> >
> 
> 
> _______________________________________________
> 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]