Skip to Content
Compare FilesText ComparisonReports

Creating Text Comparison Reports

From a text comparison, DeltaWalker Classic can produce two kinds of reports, HTML reports and patches, with File > Report > Create HTML… and File > Report > Create Patch….

HTML Comparison Reports

An HTML text comparison report is a high-fidelity representation of the file comparison it was generated from, including the most important settings that were in effect at the time of the comparison. If Show inline differences is on (Settings > Application > Appearance > Text Comparisons), inline differences are shown in the report as well. The report also reflects whether it was generated for a two-way or a three-way comparison. This makes HTML reports well suited for sending by email, for keeping for later reference, and as snapshots that document the history of changes of a particular set of files.

Software Patches

A patch is a text file that contains the differences between one or more pairs of files. A number of open-source programs, including UNIX diff, Subversion, and CVS, as well as commercial applications, including DeltaWalker Classic, can produce patches. Updating a file with the differences from a patch file is known as applying a patch, or patching. While patches originated in the programming world and are particularly suitable for updating source files to newer versions, they can be applied to any text files.

The Create Patch dialog offers the options below. In DeltaWalker Classic 3.0.7 the patch is always written in Unified format, with three lines of context, in UTF-8, whatever you choose in the dialog; only the file name you choose is used. The options are described here as the dialog presents them.

Patch Format

ED script—historically, the first output format suitable for automatically transforming one file into another; today, it is almost obsolete. An ED script consists of commands that direct ed, the standard UNIX text editor, to change the first file into the second. It lacks context and does not provide the information necessary to apply the patch in reverse, that is, to transform the second file into the first.

Normal—shows each block of differences with no surrounding context, which is sometimes the clearest way to see how the lines have changed. Because the Context and Unified formats can produce similar output with zero lines of context, and because they are otherwise superior, this format is no longer widely used; DeltaWalker Classic provides it mostly for compatibility.

Context—shows the changed lines in context, that is, together with the unchanged lines before and after them. This makes the patch file easier to read and allows a patch to be applied to a file even when the file has been modified since the patch was created. These characteristics have made it a standard format for distributing updates to source code.

Unified—inherits most of the characteristics of the Context format, but is typically shorter because it omits redundant context lines, and its output is easier to read. This is the default format.

Lines of Context

Use the with … lines of context spinner to specify the number of context lines, that is, the lines before and after a difference. This option is available only for the Context and Unified formats. The default is three, but you can set it to any number, including zero. For a context or unified patch to be applied reliably, at least three lines of context are recommended.

Encoding

Use Encoding to set the character encoding of the patch file. Almost always, the first and the second files use the same character encoding; in the rare case that they differ, you will most likely need to select the encoding of the destination file.

Line Ending

Use Line ending to choose the line ending of the patch file. As with the character encoding, if you need to select a line ending explicitly, it should most likely be the line ending of the destination file.

最后更新于