qdiff (see also)

You use qdiff to compare different files. The files may be either revisions within a QVCS archive, or regular non-QVCS files. It is similar to most diff-style file comparison utilities except that it can also compare one revision to another revision, and it can compare binary files. It can also be used to create edit files containing only the delta between revisions that the qedit utility can use to convert one revision of a file to another revision of that same file.

qdiff uses the same code and algorithm that qput and QWin use when inserting a new revision into a QVCS archive.

If either of the files are binary, or if you use the -b switch, qdiff displays the differences in hexadecimal format, followed by characters for those hex characters that are printable.

When comparing different revisions of the same QVCS archive, it's useful to disable keyword expansion (using the -a EXPANDKEYWORDS=NO option). If keywords are expanded, in addition to the finding the differences in the files, qdiff will also find differences in the keyword expansions. These differences are generally not useful.

Command Template

qdiff [-editout editFileName] [-b] [-a EXPANDKEYWORDS={YES|NO}] FILESPEC_1 FILESPEC_2

where:

-editout editFileName (optional)

Indicates that you want qdiff to create an edit file (for use by the qedit utility). The edit file name is given by the filename that follows that editout command option. When the editout option is present on the command line, qdiff does not display the file differences on the screen.

-b (optional)

Indicates that the files should be treated as binary files. qdiff displays the output of a binary file compare differently from the output of a text file compare.

-a EXPANDKEYWORDS=YES or -a EXPANDKEYWORDS=NO (optional)

If keywords are present in a revision retrieved from a QVCS archive, this command line switch can be used to override the QVCS archive settings that indicate whether QVCS keywords are expanded when the revision is fetched. Use NO to suppress the expansion of keywords, YES to cause keywords to be expanded. In the absence of this command line option, qdiff uses the QVCS archive attributes to determine whether to expand QVCS keywords. This command line switch applies to both FILESPEC_1 and FILESPEC_2.

FILESPEC_1 and FILESPEC_2 (required)

FILESPEC_1 and FILESPEC_2 indicate the names of the files to compare. qdiff deduces the actual files to compare based on the format of FILESPEC_x. FILESPEC_x has the following format:

[[-r REVISION] filename]|[filename]

If the -r REVISION form is used, filename is interpreted as the work file associated with a QVCS archive, and REVISION is taken to be the indicated revision in that QVCS archive.

If the -r REVISION form is not used, filename is interpreted as the name of the file to be compared, i.e. it is assumed to be a file that is not in a QVCS archive.

If either FILESPEC_1 or FILESPEC_2 are from QVCS archives that have the BINARYFILE attribute set to true, qdiff will use the binary format for the results of the compare.

Examples

qdiff -r 1.0 foobar.c -r 1.6 foobar.c
compares revision 1.0 from foobar.c's QVCS archive to the 1.6 revision from that same QVCS archive.

qdiff foobar.c -r 1.6 foobar.c
compares the foobar.c work file to revision 1.6 from foobar.c's QVCS archive.

qdiff foobar.c poohbar.c
compares foobar.c to poohbar.c (neither file is in a QVCS archive).

qdiff -b -r 1.0 foobar foobar
compares revision 1.0 from foobar's QVCS archive to foobar in the current directory. The output will use the format used for binary files.

qdiff -a EXPANDKEYWORDS=NO -r 1.1 foobar.c -r 1.5 poohbar.c
compares revision 1.1 from foobar.c's QVCS archive to revision 1.5 from poohbar.c's QVCS archive. Keyword expansion is disabled for both foobar.c and poohbar.c.

qdiff -r TRUNK foobar.c foobar.c
compare the latest TRUNK revision in the foobar.c QVCS archive with the foobar.c work file.

qdiff -editout foobar.edit -r 1.1 foobar.c -r 1.5 foobar.c
compares revision 1.1 of foobar.c's QVCS archive to revision 1.5 of foobar.c's QVCS archive, and writes those differences into foobar.edit in a binary form that can be used by the qedit utility. qedit can then later be used to transform another copy of a 1.1 revision of foobar.c into a 1.5 revision of foobar.c.


Command Line Utilities
qdelrevqdiffqeditqgetqidentqlockqlogqmergeqmodhdrqmodrevqputqstampqunlockqunstampqrecurse


See also: QWin's corresponding Compare tool.