Comparing files
This section describes how to compare and merge files. To see the available configuration options, see File Comparison options.
Compare two local files
This section shows you how to compare two files on a local drive.
To compare local files using the Standalone File Compare/Merge:
- From the Windows desktop, choose Start > Program Files, navigate to your StarTeam program installation group, and choose File Compare Merge.
-
Click the
Open New Comparison button at the top right of each editor pane, and browse to the files you want to compare.
Note: The Open New Comparison button displays a list of your previously opened files.
-
Right-click in any pane and choose
Switch Comparison Modes to specify a comparison display layout.
Tip: You can open additional file comparison windows by pressing Ctrl+N .
- Edit the files by typing directly in the edit panes, or by using the dynamic editing buttons in the color difference blocks.
- Optionally, right-click in one of the panes and choose Generate Report.
-
Choose
Note: If you want a report of your changes, you must generate the report before closing the File Compare/Merge window.
to print the report.
- Choose to save all changes, or click the Save Changed Text File button above each pane to save each changed file individually.
- Optionally, test your changes to ensure there are no problems, then check the change files into StarTeam.
Compare a local file with a repository file
This section shows you how to compare a local file with a file in a repository.
To compare a local file with a repository file:
-
Select a
StarTeam repository file to compare with your local file.
Note: You can select the tip revision a file in the upper pane, or a previous revision on the History tab.
-
Right-click the selected file and choose
Compare Contents.
The File Compare/Merge session opens in a separate window, with each file in its own edit pane.
- Click the down arrow to the right of the Switch Comparison Modes toolbar button and select a comparison mode.
- Perform any required edits to the files directly in the edit panes.
Tip: You can also use the embedded Compare panes to quickly compare two files. Selecting two files in StarTeam, and choose . You can view files but you cannot edit files in the embedded Compare panes.
Compare images
You can use the Standalone File Compare/Merge to compare two images on your computer. You cannot edit the files directly, but you can swap the contents of one image with the contents of another one.
File Compare/Merge provides a toolbar with a few common actions that control the editor pane display. It also includes some image comparison tools for zooming in and out, and moving the file around.
To compare images:
- From the Windows desktop, choose Start > Program Files, navigate to your StarTeam program installation group, and choose .
- Choose File > New Image Comparison (Ctrl+Alt+N ) to open a new image comparison tab.
-
Click the
Open New Comparison button at the top right of each editor pane, and browse to the images you want to compare.
Note: The DOWN ARROW to the right of the Open New Comparison button stores a history of your previously-opened images. You can open the Save File As dialog box by clicking the DOWN ARROW to the right of the Save Changed Text File button.
- (Optional) Click the DOWN ARROW to the right of the Switch Comparison Modes toolbar button and choose either a 2-Way Vertical or 2-Way Horizontal display.
- (Optional) Click Zoom In, Zoom Out, or Move on the toolbar to examine your image in more detail.
-
(Optional) Use the double left or right-arrow buttons at the top of the image comparison panes to replace one image with the other.
The content of the source image replaces the contents of the target image without change the filename.
- Click the Save Changed Image button at the top of the pane that contains the changed image, or close the image comparison pane and you will be prompted to save your file if you have modified it.
Tip: You can open additional image comparison windows by choosing File > New Image Comparison on the File Compare/Merge main menu, or by pressing Ctrl+Alt+N .
Compare historical file content
You can only compare historical file content using the Main or Embedded File Compare/Merge tool in the StarTeam client. You cannot edit historical file revisions.
To compare historical file content:
- Click the History tab and select two revisions to compare.
-
Choose
The embedded compare panes display the contents of the two files at the bottom of the StarTeam window.
.
Note: You can also compare the properties of two non-File items, such as a change request, or two revisions of the same non-File item. Select the two non-File items, then choose . This opens the embedded double-paned compare view at the bottom of the window and displays the properties of the two selected items.
Merge two local files
Use the Standalone File Compare/Merge to merge the contents of two files on your computer.
To merge two local files:
- Click Start > All Programs > Micro Focus > StarTeam Cross-Platform Client <version> > File Compare Merge.
-
Click the
Open New Comparison button at the top right of each editor pane.
Browse to the files you want to compare, or enter the path for each file in the directory field above each pane.
Tip: The DOWN ARROW to the right of the Open New Comparison button above each pane stores a history list of the previously-opened files in that pane from which you can choose.
By default, the files are immediately compared, and displayed in the panes with line numbers.
File Compare/Merge highlights the differences between the two files using colors and linked lines, with the linked lines connecting the related differences in the two files. You can set the colors used in the editor panes in the File Compare/Merge Options dialog box on the Color Preferences page for File Comparisons.
-
Right-click in any pane and choose
Switch Comparison Modes.
Choose 3-Way Vertical, 3-Way Horizontal, or 3-Way Mixed.
In the 3-Way Vertical and 3-Way Horizontal comparison modes, the merged base file is in the center pane. In the 3-Way Mixed comparison mode, File Compare/Merge places the merged base file in the lower pane.
Tip: You can open additional file comparison windows by choosing File > New Comparison on the File Compare/Merge main menu, or by pressing Ctrl+N .
-
Perform any required edits to the files directly in the edit panes.
File Compare/Merge provides a context menu and toolbar with the most commonly used actions that you will need to perform in the editor panes.
-
Optionally, right-click in one of the panes and choose
Generate Report.
To print the report, choose
.Note: If you want a report of your changes, you must generate it before closing the File Compare/Merge session.
- Choose to save all of your changes, or click Save Changed Text File button above each pane to save them individually.
- Optionally, test the modified file to ensure there are no problems with it.
- Check in the file.
Edit files in a File Compare/Merge session
Use the Standalone File Compare/Merge to edit the comparison files.
To edit files:
-
Start a main or standalone
File Compare/Merge session on two files you want to compare.
The File Compare/Merge panes display the differences between the two files in color differences blocks.
-
Edit the files by modifying text directly in the edit panes.
Use standard editing techniques or use the dynamic editing buttons in the color differences blocks.
Note: You cannot modify the actual revision of a file in the StarTeam repository. If one of the files you are comparing is a revision in the repository, File Compare/Merge creates a temporary copy of the file locally, which you can also edit and save locally with a different filename.
Save files modified in a File Compare/Merge session
If you edit a file during a File Compare/Merge session, you can save the edited file from the File Compare/Merge window, or be prompted to save the edits when you exit File Compare/Merge.
To save the files:
-
Start
File Compare/Merge and make your edits and/or merge the files.
The Save Changed Text File button becomes active above each pane containing modifications. It is located to the right of the File Path/Name field directly above the editing pane.
-
Save the modified files using one of the methods below:
- Click the Save Changed Text File button above each pane that contains the edits you want to save. The file is saved with the existing name and path, which is displayed in the File Path/Name field.
- Click the DOWN ARROW beside the Save Changed Text File button and choose Save As to save the file with a different name and/or path than that displayed in the File Path/Name field. A file browser opens for selecting the path and specifying the filename.
- Choose to save all files that have been modified in File Compare/Merge with their current names and paths.
- Choose Save Results dialog box opens and prompts you to save the files that have changed. Check the specific files you want to save and click Yes. The files are saved with their current name and path. to close the current tab pane containing a File Compare/Merge session. The
- Choose Save Results dialog box opens and prompts you to save all files that have changed. Check the specific files you want to save and click Yes. The files are saved with their current name and path. to close all the active File Compare/Merge sessions. The
Note: If you edit the temporary copy of a file revision from the StarTeam repository, unless you explicitly save that file to a different location with a new name, File Compare/Merge assigns the file a new name and saves it in a temp folder in your local home folder. The naming convention is the word star, followed by numbers (for example, star23276.xml). The file extension remains the same as the original file.
Merge a local file with the tip revision
You can use File Compare/Merge to merge the contents of a local working file with the tip revision of the file in StarTeam. For example, if the file in your working folder has been modified, but is not based on the tip (latest) revision of this file, it is marked with a Merge status. This status usually occurs when you and another person have both been working on a file, but the other person has checked it in before you. To check in your edits without losing the edits of the other person, you can compare the contents of the files, reconcile the differences between them, and merge the contents into one file.
To merge a local file with the tip revision:
-
Select a file in
StarTeam with a file status of
Merge or
Unknown, and choose
A message appears giving you the option to merge the contents of the two files.
.
-
Click
Yes to merge the contents.
The File Compare/Merge window opens in a 3-way Vertical comparison mode. The two files you are comparing display in the right and left panes, and a center pane displays the merged base file. If you want to use a different comparison layout, right-click in one of the panes and choose Switch Comparison Modes. You can choose either 3-way Horizontal or 3-way Mixed comparison mode. In the 3-way Mixed mode, the base file is in the lower pane.
Note: You can edit in all the panes in the standalone File Compare/Merge, and you can replace or append text in the base file with highlighted text from the left and right panes.
-
Edit and/or merge the contents of the files using one or more of the following methods:
- Perform an automatic merge: Right-click in a File Compare/Merge pane and choose Nonconflicting Parts Auto Merge or Full Auto Merge. Nonconflicting Parts Auto Merge places only the nonconflicting portions of the two compared files into the base file. Full Auto Merge parses the two files, examines the changes, and automatically decides whether to keep or add each change to the final base version of the file.
- Edit any of the files directly. You can perform common text-editing actions such as type, cut, copy, paste, and undo.
- Copy text from the right and left panes using buttons that appear in the top right corner of the color differences blocks. These buttons appear dynamically when you hover the mouse cursor over a color differences block. If you do not select specific text to copy to the center pane, File Compare/Merge copies the entire highlighted block of text.
Note: You can also use the toolbar and the context menu to navigate in the panes, control scrolling behavior, search for text, and perform other basic actions.
-
Optionally, right-click in one of the panes and choose
Generate Report.
To print the report, choose
.Note: If you want a report of your changes, you must generate it before closing the File Compare/Merge window.
-
Choose
File Compare/Merge closes, and updates the file status to Modified in StarTeam.
when you are satisfied with the merged results.
- Optionally, test the modified file to ensure there are no problems with it.
- Check in the file.