Comparing or merging folders
This section describes how to compare and merge folders.
Folder Comparison options
The following option settings apply to folder comparisons which are only available in the standalone version of File Compare/Merge, accessed from the Start Menu. To access these options, choose Tools > Options > Folder Comparison. Expand the links below to view all of the options.
Below are the options available on the first page of the Folder Comparison node.
Option | Description |
---|---|
Tree Font |
Sets the font style and size displayed in the result panes. |
Ignore Extensions |
Designates any file extensions to ignore while comparing folders, for example, dll;exe |
Show Only Extensions |
Designates only specific file extensions to show while comparing folders. |
Ignore Folders |
Enables you to list folders that you wish to ignore while comparing folders. |
Do Not Show Empty Folders |
Ignores empty folders while comparing folders. |
Use Compact View |
Uses a compacted view if you have files in one folder that do not exist in another folder (files to be inserted). The view showing the folder without those files displays a collapsed color block as a line indicating that the files are not in the other folder. If the option is not selected, the view displays a full color block representing the missing files for the folder that does not contain the files. |
|
Highlights uncommitted changes in the View pane. |
|
Hides all folders in which there are no differences so the only folders visible in the tree are the ones with differences. |
You can apply these settings to compare folders at a more granular level. File Compare/Merge uses these options to find similar files regardless of folder structure and folder names.
Option | Description |
---|---|
Use File Names In File Matching | Specifies whether to use the file name or the content for comparison. If true, the file name is used to identify files that are the same. If false, the content will be used to identify files which are the same. |
Match Files By Name When No Content Match Is Found |
If true, File Compare/Merge uses the file name to compare file contents when the application cannot find any matches in the contents. |
Use Folder Names In Folder Matching |
Specifies whether to use the folder name for comparison. If true, the folder name is used to identify folders that are the same. If false, File Compare/Merge matches folders regardless of the name. |
Maximum Number Of Lines In Matching Files |
Specifies the number of lines read when comparing the contents of two files. Differences past the specified maximum number of lines are ignored |
Rate Of Proximity In File Matching |
The percentage of similarity in comparing files with similar content. |
Use Alternative Tree Diff Algorithm |
This algorithm behaves as follows: The original folder structure for matched files is not kept and you cannot see (by using the quick switch button on the toolbar) the conventional comparison results and make appropriate copy operations. Only the first encountered file that conforms to the matching criterion is kept. Uses a different approach to match folders that contain similar files. |
The Report Transformer options enable you to define new transformers, edit existing ones, or remove transformers from the list. These options are available whenever you choose to generate a report (click Generate Report in the toolbar). You can choose to use an empty transformer, use one of the predefined transformers, or create your own.
Report Transformers List |
Displays the list of report transformers available for use in transforming XML files to various outputs. |
Add/View & Edit |
Allows you to add, view, or edit a report transformer XSL file using the Report Transformer Configuration dialog box. |
Remove |
Allows you to remove a selected report transformer from the list. |
Use the Color Preferences to control the colors displayed for file comparisons in the editor panes.
Component Type |
Displays a list of the types of components that can be color coded in the File Compare/Merge window. The Background Color button automatically changes colors to reflect the type of component selected. The text preview area shows the current color configuration settings. |
Background Color |
Displays the color of the selected Component Type. This button also launches the Select Color dialog box where you can specify a different color. |
Compare folders
Using the Standalone File Compare/Merge, you can compare and restructure folders on your computer. You can also start a file comparison from a folder comparison. If you have not modified the General options settings, File Compare/Merge automatically begins comparing folders as soon as you select them.
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.
- From the Windows desktop, choose Start > Program Files, navigate to your StarTeam program installation group, and choose File Compare Merge.
-
Choose
Note: Using the New Folder Comparison command opens the folder comparison results with Auto Commit On. To open a folder comparison with Auto Commit Off, choose File > New Folder Merge. Once File Compare/Merge is opened, you can click Auto Commit Mode on the toolbar to toggle between Auto Commit On or Auto Commit Off.
(
Ctrl+Shift+N
) to open a new folder comparison tab.
-
Click the
Open New Comparison button at the top right of each editor pane, and browse to the folder you want to compare.
Note: Alternatively, you can type the path to each folder to the left of the Save Changed Text File button, or click the drop-down arrow on the Open New Comparison button and select a folder from the history list.
By default, File Compare/Merge immediately compares the selected folders, and the results display in the two panes of the File Compare/Merge window. You can change this and other default settings in the File Compare/Merge Options dialog box on the General and Folder Comparison pages.
-
Optionally, right-click and choose
Switch Comparison Modes to choose a different comparison mode display.
If you choose one of the 3-Way comparison modes, you will have a third pane.
-
Perform any required changes to the folders directly in the edit panes. You can move, delete, and copy folders from one pane
to the other, and are prompted to commit your changes.
If there are differences between individual files in the folders you are comparing, you can also start a file comparison from the folder comparison pane. Double-click the file in the folder comparison pane, or selecting it and click Open New Comparison on the toolbar. A new file comparison pane opens displaying the contents of the two files where you can edit, merge, and save your changes.
File Compare/Merge highlights the differences between the two folders using colors and linked lines, with the linked lines connecting the related differences between the panes.
Tip: You can open additional folder comparison windows by choosing File > New Folder Comparison on the File Compare/Merge main menu, or by pressing Ctrl+N .
Merge folders
Merging folders is similar to merging files, except you are merging folder contents instead of file contents. However, if two files in a folder have differences, you can open a file comparison on those files from the folder comparison pane.
You can only merge folders 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.
-
Choose
File
> New Folder Comparison (
Ctrl+Shift+N
, or
File
> New Folder Merge (
Ctrl+Shift+M
to open a new folder comparison tab.
Note: Using the New Folder Merge command opens the folder comparison results with Auto Commit Off. To open a folder comparison with Auto Commit On, choose File > New Folder Comparison. Once File Compare/Merge is opened, you can click Auto Commit Mode on the toolbar to toggle between Auto Commit On or Auto Commit Off.
-
Click the
Open New Comparison buttons above each editor pane, and browse to the folders you want to compare.
Alternatively, click the DOWN ARROW to the right of the Open New Comparison button and select a folder from the history list, or type the path for each folder in the directory to the left.
By default, File Compare/Merge immediately compares the selected folders, and the results display in the two panes of the File Compare/Merge window. You can change this and other default settings in the File Compare/Merge Options dialog box on the General and Folder Comparison pages.
-
Optionally, right-click and choose
Switch Comparison Modes to choose a different comparison mode display.
If you choose one of the 3-Way comparison modes, you will have a third pane for viewing and editing the merged base folder.
-
Perform any required changes to the folders directly in the edit panes. You can move, delete, and copy folders from one pane to the other, and are prompted to commit your changes.
The toolbar and context menus are different for folder compare/merge than for file compare/merge. For folder comparisons, you have items for moving or copying files and folders left or right, deleting files and folders from the right or left panes, and several options for expanding/collapsing tree nodes.
- Optionally, double-click a file with differences to open a new File Comparison pane and resolve the differences.
-
Optionally, right-click in one of the panes and choose
Generate Report.
To print the report, choose File > Print.
Note: If you want a report of your changes, you must generate it before closing the File Compare/Merge window.
- Select Save Changes To Disk on the toolbar to save your changes when you are finished.
See also: