Search code examples
clearcase

Clearcase: Merging two files


I have checked out a file say "a.c" in my activity branch which is having version 3 from main line in clearcase and I did some changes to that file.

Now I want to do check in of that file on the main line but the latest version of that file in main line is now 7.

I want to put my changes to that file and hence it will create the version 8 of that file.

So how can I do check in so that I can merge my changes to the latest version of file. In other words I am having 3rd version of a file and I want to give my changes to the latest version of the file


Solution

  • Even before the delivery, a simple checking should trigger the merge, in an UCM dynamic or snapshot view.

    If there is any conflict, the cleartool mergetool will popup then.

    That is what this technote details:

    To merge the latest version with your checkout

    When you first check in (on Windows systems, issue the Check In command for) a non-latest version of an element, one of the following actions occur:

    • On the UNIX system and Linux, you see a message that the version you checked out is not the latest on the branch, and the checkin is prevented.
      Enter a command in the following format:

      cleartool merge -graphical -to file-or-directory-in-your-view \
          file-or-directory-name@@/main/LATEST 
      

      Using the -graphical option starts the Diff Merge or, if you merge XML versions, the XML Diff Merge tool.
      The argument on -to specifies your checked out element.
      The other argument is a version-extended pathname that specifies the latest version on the branch on which you are working (see the pathnames_ccase reference page for a complete description of syntax).
      After the merge completes, save the results and check in the version by entering the cleartool checkin command from the view.

    • On Windows systems, a window opens and asks whether you want to merge the file now. If you choose to merge, an automatic merge is attempted. If your input is needed to complete the merge, the Diff Merge or XML Diff Merge tool starts. After the merge completes, you are prompted to check in the element.