Search code examples
clearcasecleartool

Script to prepare scenarios to test findmerge command


I'm testing a clearcase merge script and I'd like to be able to have another script that could produce these 2 test scenarios every time it runs:

  1. Modify 3 files for a trivial merge (100% automatic, no diff needed)
  2. Modify 3 files for a conflicting merge, user resolution required

What I'd like to know are the steps/clearcase commands needed to prepare these files. All must be done through command-line (using cleartool commands). I already have a dynamic view and some test files I can use. Probably I'll need to create a destination test branch too.

The merge is done using the ct findmerge command like this:

`cleartool findmerge filepath -fver version  -merge -log NUL -c comment`

I need to validate the output in each of the cases, to include them in a report and also ensure that no user interaction is required.


Solution

  • You need:

    • to have two branches where you makes your parallel evolutions in your files
    • to use simply cleartool checkout -nc myFile ; echo new modif >> myFile ; cleartool checkin -nc myFile for adding evolution with a trivial merge in one branch (leave the same file untouched in the other branch)
    • to use the same process in both branches with a different echo each time in order to add a new line different in both version of myFile: that will result in non-trivial merge.

    Don't forget that you can also have trivial/non-trivial merges on the directory level (when files are added/removed): a non-trivial one would be in case of an evil-twin.