info-cvs
[Top][All Lists]
Advanced

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

RE: Problem: Merging Trunk and Branch several times


From: Yuval Rotem
Subject: RE: Problem: Merging Trunk and Branch several times
Date: Mon, 27 May 2002 11:55:13 +0200

Hi,
In our company we have very similar requirements. Following advice from
this mailing list, here's what we do:

1. Updates from trunk to branch
For each branch keep a moving tag on the trunk which points to where you
last updated from the trunk to that branch. Let's call it
last_branchXXX_update. Initially this tag = start point of your branch.
Your branch update procedure should be:
- update (-j last_branchXXX_update -j HEAD)
- solve conflicts
- commit to branch
- move tag on trunk to HEAD

2. Updates from branch to trunk
The important point here is the requirement that the branch will be
fully updated with the trunk first (last_branchXXX_update = HEAD). While
the branch update is being done, changes may be committed to the trunk,
so you might need to repeat the update procedure a few times.
When the branch is fully updated with the trunk, you don't need another
update, with possible conflicts, etc. - All you want is that the trunk's
content will be exactly as the branch. Quoting Greg A. Woods, you need
to:

1) Check out a working directory on the branch.
2) Check out a working directory on the trunk.
3) Copy all the project files (i.e. not the CVS/* files!) from the
working directory created in step #1 to the working directory created in
step #2.
4) within the working directory created in step #2 "cvs add" any new
files (show as '?' in "cvs -nq update") and "cvs remove" any old files
(have timestamps older than the copy in step #3)
5) "cvs commit" in the working directory created in step #2


You should write scripts to perform the two update operations (as well
as for creating branches) - it's too error prone to be done manually.
These scripts should also handle commit failures, etc.

Yuval.


> -----Original Message-----
> From: Ralf Beckers [mailto:address@hidden
> Sent: Thursday, May 23, 2002 4:23 PM
> To: address@hidden
> Subject: Problem: Merging Trunk and Branch several times
> 
> 
> Ahoi,
> 
> I have a little problem with understanding CVS ...
> 
> We need to develop on the trunk, where all general improvements and 
> bugfixes are done (not release specific bugfixes!).
> We also develop new features in new branches, till they are stable.
> Sometimes, it is neccessary to merge bugfixes from the trunk 
> to the branch. 
> Sometimes, there will be a merge from the branch to the trunk.
> To avoid conflicts, we use update with 2 times -j to get just 
> the changes 
> and not the merges (the "own" code back). Therefor we set 2 tags
> (premerge and merge), for better access.
> The poor thing is, that we won't get the "conflict 
> solutions", since the 
> merged-tag will be set after the commit.
> (I've done a poor ascii-art for more details).
> 
> 
> --- time --->
> 
>           branch 
> +-------------(A1)-(T2)--+----------------(A5)-(T5)-(A6)
>                  | code changes           *        code 
> changes       ^
>                  | plus conflict          *                   
>        /*\
> - root-of-brnch -+                        *                   
>         *
>                  |                       \*/                  
>         * 
>                  | code changes           V        code 
> changes       *
>           trunk  
> +-------------(A2)-(T1)-(A3)-(T3)----------(A4)-(T4)-+ 
> 
> 
> T1 = cvs tag premerge-brnch_1
> T2 = cvs tag branch-brnch_1
> A1 = cvs commit
> A2 = cvs commit
> A3 = cvs update -j root-of-brnch -j branch-brnch_1
>      emacs to solve conflict.
>      cvs commit
> T3 = cvs tag merged-brnch_1
> A4 = cvs commit
> T4 = cvs tag trunk_bugfix_1
> T5 = cvs tag premerge_bugfix_1
> A5 = cvs commit
> A6 = cvs update -j root-of-brnch -j premerge-brnch_1
>        -> conflict (again!)...
> 
> now I got a conflict in the line, which causes the conflict 
> before within 
> the trunk-merge.
> Is it really neccessary to fix this conflict twice? How can I 
> then ensure, 
> that it will befixed 
> the same way as in the trunk, and that the code is identical?
> 
> Or do we use CVS the wrong way (how can this merges be used better)?
> 
> Thanks in advance,
> Ralf Beckers
> _______________________________________________
> Info-cvs mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/info-cvs
> 



reply via email to

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