Comparing objects

Each type of object for which you can compare source has default compare tools predefined by Rational® Synergy for both the CLI and the GUI. The default compare tool for the GUI is interactive, and the one for the CLI is automatic. The compare tool shows the differences between different versions of files or directories.

The default compare tool is specified in the ccm.properties file for UNIX and Windows. You can specify a different compare tool for each object type. The specified compare tool applies to the specified type and any subtype without a specified compare tool. By default, only the ASCII file type has a compare tool defined.

For example, If you define a "japanese" file type, and you want a comparison of Japanese files to be done in a different encoding than ASCII files, you can specify it as follows.

ccm.cli.tools.compare.japanese.windows="%ccm_home\\\\bin\\\\util\\\\cc_dff.bat" "%ccm_home" %{encoding[null='SJIS']} %outfile %file1 %file2

By default, a compare tool is not set for the binary type or its subtypes, but you can set a compare tool manually.

Additionally, you can set encoding rules in the ccm.properties file so that compared files display the correct language, as follows:

// Command to compare source objects on UNIX and its checkstatus.
ccm.cli.tools.compare.ascii.unix=%ccm_home/bin/util/cc_dff %ccm_home %{encoding[null='CP1252']} %outfile %file1 %file2^M
// Command to compare source objects on Windows and its checkstatus.
ccm.cli.tools.compare.ascii.windows="%ccm_home\\\\bin\\\\util\\\\cc_dff.bat" "%ccm_home" %{encoding[null='CP1252']} %outfile %file1 %file2

The second parameter to the ccm_diff command allows you to specify an encoding for the file being compared. The syntax “%{encoding[null='CP1252']}” is interpreted as follows:

If the object type specifies a work area encoding with the encoding_rules attribute, use that encoding for the compare. If not, use the CP1252 encoding. (See File encodings for a discussion of the encoding_rules attribute.)

You can specify a default encoding other than CP1252 for this parameter. For example, the following syntax indicates to use the UTF8 encoding if an encoding is not specified on the object type:

ccm.cli.tools.compare.ascii.windows="%ccm_home\\\\bin\\\\util\\\\cc_dff.bat" "%ccm_home" %{encoding[null='UTF8']} %outfile %file1 %file2

The following syntax indicates to always use the CP1252 encoding:

ccm.cli.tools.compare.ascii.windows="%ccm_home\\\\bin\\\\util\\\\cc_dff.bat" "%ccm_home" CP1252 %outfile %file1 %file2

The valid encodings are CP1252, UTF8, BIG5, eucJP, EUC-KR, SJIS, and GB18030.

The files being compared and the ancestor file must have the same encoding.

For example, in a Chinese-language database, you might set the following encoding rules for the ascii type:

Server-encoding: GB18030
Unix-wa-encoding: GB18030
Windows-wa-encoding: GB18030

Assuming the default encoding parameters for the ccm_diff command were used, the CLI and GUI compare tools are then invoked with the GB18030 encoding.

Alternatively, if your site contains only Chinese-language databases, you can change the default compare command as follows, and then encoding_rules attributes are not required on the ascii type.

ccm.cli.tools.compare.ascii.windows="%ccm_home\\\\bin\\\\util\\\\cc_dff.bat" "%ccm_home" %{encoding[null='GB18030']} %outfile %file1 %file2

About this task

ccm diff  [-vc|-versioncompare] object_spec1 [object_spec2]
object_spec1
object_spec1 specifies the first file or directory to be compared. You can set object_spec1 to be a Object specification for one file or directory.
object_spec2
object_spec2 specifies the second file or directory to be compared. You can set object_spec2 to be a Object specification for one file or directory. If object_spec1 is a file, then object_spec2 must also be a file. If object_spec1 is a directory, then object_spec2 must also be a directory.

Feedback