ClearCase‎ > ‎UCM FAQ‎ > ‎

Howto merge using the ClearCase Merge manager

The ClearCase Merge Manager is an 'old' tool that was around even before UCM was even invented. Back in the old days the merge manager was the tool to use when you wanted to merge stuff from one branch to another.

In UCM the terminology has changed - you don't merge branches anymore - you deliver or rebase streams. But nevertheless the merge manager is still called for. Especially two scenarios makes it extremely useful - and your obvious choice of tool: To survive evil-twins when were talking about more than a few files and for merging colleagues work into your own unreserved checkouts when you are working on a Shared Stream.

Question

How can I use the merge manager to merge files in UCM?

Answer

To start the merge manager you go:
Start-> All Programs -> Rational Software -> Rational ClearCase -> ClearCase Merge Manager

Or you can simply type clearmrgman at the command prompt or from the Start -> Run box.

Scenario - Shared Stream

Let's say you are working in a shared stream, you have checked out a file reserved, and so has you colleague - you colleague has already made his changes and checked in -  and now you want to commit too. Well obviously you need to merge his changes into yours and question is - "how much is there to merge,?" You have identified one file in the version tree, but are there more than one? - if so - find them and merge them!

So startup the Merge manager as described above, or if you already have it open, hit <CTRL+N> to start a new merge scenario. 

1st step is then to select target view 

In this case you should point out the view where you have your own unreserved checkouts (click on images to see them full size).

2nd step is to select the scope

This step is very similar to selecting load rules in a snapshot view. You'll be presented to the possible scope (that the view knows of) to the left and you'll select files or directoris and add them to the scope of the search of files that needs to be merged to the right. You can select the highest level that interests you and make the search recursive.

3rd step Select the source branch

In this step you will have several options, but in the scenario we're using as our example it's most appropriate to merge the version that are LATEST on the same branch as you current view. A piece of advise! When you click on the dorp-down box to select a branch type (which should be the same as your stream name) it will take forever to open. To speed up the process type the branch name directly into the edit field or just the initial part of it - it will speed up the drop-down load  ...a lot! 

4th step - Search settings

Go with the default values - hit finish!

The fouth step in the wizard asks you if you want to merge directories automatically. That means that if directories needs merging they will be merged automatically 'on-the-fly' and the further search for elements to merge will continue into the new version of the directory. In most cases this is want you want. Another option is to search recursively in directories and this is also most often what you want. The last option deals with VOB symbolic links ...What? ...Exactly you probably couldn't care less - set it one way or the other, my guess is that you don't have any symbolic links in the VOB anyway.

Last step - Find and merge elements

From here the merge manager will find and report elements to merge.

In our scenario you'll probably see that some - if not all - of the files are checeked out reserved. That is exactly why you wanted to do the merge - remember?

When you start the merge(s) you'll probably be prompted with at warning saying the files are checked out  - "Do you want to check them in?"

You probably would - but you can't - You probably already tried that and you colleague has checked in before you and now you need to merge - before you can check in - so you only option is to go "No".

Your merge diff tool will then start up a traditional 3-way merge scenario and your result will be in a file with a .merge extension. When you are done with the merge and save and exit the diff tool the version that was in you view (you own unreserved checkout) will hve changed name to have a .contrib extension and the merge result will now be you view-private checkout.

You're ready to check in!


Comments