Frequently Asked Questions

For a Simple ClearCase Installation

Dwain Wilder

Version: 0.1

Questions:

  1. I need to pre-merge my branch with another branch because changes to the files I am working on have been merged to the main branch since I started work. How do I do a pre-merge the files on my branch with changes on the main branch?

Answers:

How do I do a pre-merge the files on my branch with changes on other branches?

(Contributed by Steve Kerxhalli) To do a "pre-merge", you can use the recommended config spec for development using the most recent baseline. For example, using my branch type of "ob_sjk_03", my config spec would look like:

element * CHECKEDOUT
element * .../ob_sjk_03/LATEST
element * OUTBREAK_004I -mkbranch ob_sjk_03
element * OUTBREAK_004H -mkbranch ob_sjk_03
element /vob/fx/... OUTBREAK_004 -mkbranch ob_sjk_03
element /vob/pkgs/... OUTBREAK_IL_3.2_19970616 -mkbranch ob_sjk_03
element * /main/0 -mkbranch ob_sjk_03

In my case, I knew that the main branch of development for Outbreak, in /vob/fx, occurs on "outbreak_main", so I wanted my branch-point to sprout from "outbreak_main". Additionally, I raised the baseline reference for all elements which do not have revisons on "outbreak_main" from OUTBREAK_004 to FX351_116.

troll% ct catcs
element * CHECKEDOUT
element * .../ob_sjk_03/LATEST
element * .../outbreak_main/LATEST -mkbranch ob_sjk_03
element /vob/fx/... FX351_116 -mkbranch ob_sjk_03
element /vob/pkgs/... OUTBREAK_IL_3.2_19970616 -mkbranch ob_sjk_03
element * /main/0 -mkbranch ob_sjk_03

Your choice of config spec will be influenced by the work you plan to do. If you think that you can do spot "pre-merges" from select V3.5.1 revisions to your Outbreak developement configuration and not cause inconsistencies, then use the first config spec (it is most familiar). If you need to test your merges in the context of other V3.5.1 modifications, then use a variation of the second config spec.

Once I have set my config spec, I can perform the merge. I recommend making one pass at the findmerge command with the "-print" option. Just in case your config spec isn't quite what you wanted, it's better to find out before the actual merges are performed.

troll% ct findmerge Makefile -fver FX351_116 -why -print
Needs Merge "Makefile" to /main/outbreak_main/14 from
/main/61 base /main/54]
Log has been written to "findmerge.log.26-Aug-97.14:28:10".

If the "findmerge -print" results were as expected, then move on to the actual merge.

troll% ct findmerge Makefile -fver FX351_116 -xmerge
Needs Merge "Makefile" to /main/outbreak_main/14 from
/main/61 base /main/54]
Checkout comments for this and any additional elements:
Pre-merge from FX351_116 so that, once this branch has been merged
into Outbreak, the "merger" will not encounter a merge conflict
when merging from FX351_116 to Outbreak.
.
Created branch "ob_sjk_03" from "Makefile" version "/main/outbreak_main/14".
Checked out "Makefile" from version "/main/outbreak_main/ob_sjk_03/0".
Log has been written to "findmerge.log.26-Aug-97.14:30:13".

If you're happy with the results of your merge, then check in your work and notify the "merger" that your branch is ready.

troll% ct ci -nc Makefile
Checked in "Makefile" version "/main/outbreak_main/ob_sjk_03/1".

When the "merger" incorporates your work now, the conflicts have already been resolved.

Merging from the "pre-merge" branch is trivial;

merger% ct findmerge Makefile -fver .../ob_sjk_03/LATEST -c "Merge branch ob_sjk_03" -merge -xmerge
Needs Merge "Makefile" to /main/outbreak_main/CHECKEDOUT
from /main/outbreak_main/ob_sjk_03/1 base /main/outbreak_main/14]
Trivial merge: "Makefile" is same as base
"/vob/fx/src/Makefile@@/main/outbreak_main/14".
Copying "Makefile@@/main/outbreak_main/ob_sjk_03/1" to output file.
Moved contributor "Makefile" to "Makefile.contrib.6".
Output of merge is in "Makefile".
Recorded merge of "Makefile".
Log has been written to "findmerge.log.26-Aug-97.14:52:32".
merger% ct ci -nc Makefile
Checked in "Makefile" version "/main/outbreak_main/15".

Merging from the V3.5.1 baseline is already done!

merger% ct findmerge Makefile -fver FX351_116 -c "Merge FX351_116 baseline into Outbreak." -why -merge -xmerge
No merge "Makefile" [/main/outbreak_main/15 already merged from /main/61]

script done on Tue Aug 26 14:54:17 1997