Using tools to compare and merge files and directories

With the ClearTeam® Explorer you can compare or merge files and directories.

About this task

When you check in a modified resource, you may need to compare your changes with ones that another team member has made to the same resource and decide how to resolve any conflicts. Certain types of nonconflicting merges, called trivial merges, are handled automatically. For merges that require you to resolve a conflict, the ClearTeam Explorer includes tools that provide type-specific compare and merge capabilities for the following types of resources:

  • Text files, including Java and other program source code
  • Folders
  • Microsoft Word files
  • HTML files
  • XML files

The available tools include external tools, based on programs that are included in the native ClearCase® client, and internal tools, which include the ClearCase Integrated (UTF-8) tools, Eclipse tools, and Rational Software Architect tools (if installed). Directory comparisons are only performed by the ClearCase tools or the ClearCase Integrated (UTF-8) tools.

In the ClearTeam Explorer, they are invoked as needed by the ClearCase compare icon Compare with Predecessor operation or the Compare with Another ClearCase Version operation, and also by Rebase Stream, Deliver from Stream, ClearCase Merge Manager, the Pending Changes view, and the ClearCase Version Tree. Merge tools can also be invoked when you perform a check-in that requires merging.

You can customize the settings for these tools using the Compare/Merge Preferences page (IBM® ClearTeam Explorer > Integration > Compare/Merge).

Procedure

  • To merge files, start the Merge Manager or perform one of the actions discussed above: rebase, delivery, or check in. If a merge is required, you are prompted and the associated tools are invoked.
  • To compare a resource with its predecessor:
    1. Select the resource you want to compare.
      Use the ClearTeam Navigator, ClearTeam Details view, ClearCase Search Results view, or the ClearCase Version Tree view. If you are working in the Eclipse environment, use any Eclipse view that supports the Team context menu.
    2. Click the ClearCase compare icon icon on the ClearCase toolbar, or take either of the following actions:
      • Select Tools > Compare with Predecessor from the ClearCase context menu.
      • In the Eclipse environment, select Compare with Predecessor from the Team context menu.
      • In the ClearCase Version Tree view, right-click a version and select Compare with Predecessor.
  • To compare multiple versions of a resource, use the History view. (Note that only the ClearCase Integrated UTF-8 and ClearCase External compare providers support the selection of more than two contributors.)
    1. In the History view, hold down the Ctrl key while selecting versions.
    2. Right-click on one of the selected versions and select Compare Selected Versions.
      If the selected versions cannot be compared, this option is not active.