clearcaseclearcase-ucmclearcase-remote-clientclearcase-automation

How to do code merge from one branch to another in ClearCase


I an new to ClearCase and started studying the ClearCase documentation.

UseCase : I have two branches - 'Branch_A' and 'Branch_B'.
I need to merge all my changes from 'Branch_A' to 'Branch_B'

I won't be able to use the ClearTeamExplorer, so only option is command line.

I read the documentation and its mentioned that cleartool findmerge command is the option for it.

But there is no direct example given for this.
Could someone please provide an command line example for this please?

Any help on this is appreciated.


Solution

  • Assuming a base ClearCase view/branch (no UCM views/Streams):

    cleartool findmerge include a relevant example:

    for the current directory subtree, compare versions visible in the current view against versions on another branch and perform any required merges.

    cd /path/to/target/Branch_B/view
    cleartool findmerge . –fversion /main/Branch_A/LATEST –merge –gmerge.
    

    The idea is to be in the view set on the target branch, with a config spec ready to create new versions.

    element * CHECKEDOUT
    element * .../Branch_B/LATEST
    element * /main/0 -mkbranch Branch_B
    element * /main/LATEST -mkbranch Branch_B
    

    The merge is done in the target view, on the target branch.


    Now if you are using UCM, then the view done on a Stream has already the right config spec.
    The idea remains the same: Execute the findmerge in the target view (after setting a dedicated activity, to record that merge)

    In that case, check "How to merge changes from a specific UCM activity from one ClearCase stream to another"

    You do not merge branches in UCM, you would merge UCM activities.