1

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.

epzee
  • 568
  • 8
  • 22

1 Answers1

1

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • great, thank you! Now, my next question would be how to change from one branch to the other before I execute these 3 commands you wrote. – epzee Apr 08 '11 at 13:19
  • @epzee: I would recommend a simple solution: using two different dynamic views, each one with a config spec set on the right branch. Use one of those view as the destination for your merge, where you will execute your findmerge. – VonC Apr 08 '11 at 13:21