vivek
vivek

Reputation: 587

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

Upvotes: 1

Views: 3037

Answers (2)

Brian Cowan
Brian Cowan

Reputation: 1083

It sounds like you are using a Base ClearCase branch to do your work. You have a few options in that case. You can, and should, check the work in on your private branch and then do your merge operation...

Options include, but aren't limited to:

  1. Use the manual cleartool merge command.
  2. Run "cleartool lsvtree -gra {file}" or use the "version tree" clearcase context menu item to bring up the version tree. Right click on the current version and you will get an option to merge to any other version...
  3. If you're using view profiles and are done using the private branch, there is a "finish private branch" option in the ClearCase home base.
  4. If you checked out unreserved on the same branch as has been updated, you can use the vtree browser or the command prompt to merge your changes forward and check them in.

Upvotes: 0

VonC
VonC

Reputation: 1330052

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.

Upvotes: 1

Related Questions