SnapshotCM In Depth: Viewing Differences
SnapshotCM provides powerful options for viewing the content
differences of files. In this article we look in depth at the options for
displaying file differences.
Selecting the Format and Other Options
The GUI's Difference Options dialog allows you select the
difference type to display. It is opened when using a menu to perform a diff,
and also if the shift key is held down when the tool-bar "Show Differences"
button is pressed. The dialog is shown here:
In addition to selecting the difference type, you also can
change the specific revisions to compare, select from several output options,
and set the selected options as the defaults for future compares.
Difference Types
SnapshotCM provides five difference types: in-line, context,
unified, tkdiff and external.
The in-line format type displays just the lines which
are different between two files. Example output, with two modified lines, looks
like:
84c84
< VALUE "FileVersion", "1, 85, 2, 6"
---
> VALUE "FileVersion", "1, 85, 2, 8"
89c89
< VALUE "ProductVersion", "1, 85, 2, 6"
---
> VALUE "ProductVersion", "1, 85, 2, 8"
All lines which are identical in the two revisions are
suppressed. We often use this format type to quickly review differences in many
files in a quick, concise way.
The context format type displays differences with two
identical lines of context before and after the difference lines. The same
output as above then looks like:
***************
*** 82,91 ****
VALUE "CompanyName", "True Blue Software Company"
VALUE "FileDescription", "SnapshotCM DLL"
! VALUE "FileVersion", "1, 85, 2, 6"
VALUE "InternalName", "libgui"
VALUE "LegalCopyright", "Copyright (c) 2000 - 2011"
VALUE "OriginalFilename", "libgui.DLL"
VALUE "ProductName", "SnapshotCM"
! VALUE "ProductVersion", "1, 85, 2, 6"
END
END
--- 82,91 ----
VALUE "CompanyName", "True Blue Software Company"
VALUE "FileDescription", "SnapshotCM DLL"
! VALUE "FileVersion", "1, 85, 2, 8"
VALUE "InternalName", "libgui"
VALUE "LegalCopyright", "Copyright (c) 2000 - 2011"
VALUE "OriginalFilename", "libgui.DLL"
VALUE "ProductName", "SnapshotCM"
! VALUE "ProductVersion", "1, 85, 2, 8"
END
END
Note that the two difference sections are merged since
their context's touch, and that the context is duplicated in the before and
after sections.
The unified format type is an alternative context
format and looks like:
@@ -82,10 +82,10 @@
VALUE "CompanyName", "True Blue Software Company"
VALUE "FileDescription", "SnapshotCM DLL"
- VALUE "FileVersion", "1, 85, 2, 6"
+ VALUE "FileVersion", "1, 85, 2, 8"
VALUE "InternalName", "libgui"
VALUE "LegalCopyright", "Copyright (c) 2000 - 2011"
VALUE "OriginalFilename", "libgui.DLL"
VALUE "ProductName", "SnapshotCM"
- VALUE "ProductVersion", "1, 85, 2, 6"
+ VALUE "ProductVersion", "1, 85, 2, 8"
END
END
Many prefer this more concise format as it avoids
repeating the unmodified context lines. Both context formats enable a more
in-depth understanding of revision differences. And both also support, when
Show C function is enabled, displaying the C-language function context
in the header of each diff section.
When the in-line, context or unified
format is selected for a multiple file diff, the output is aggregated into a
single report window if the Reuse Dialog option is selected.
The tkdiff format type invokes the public domain
tkdiff tool to display the differences. Tkdiff displays the full revisions side
by side while highlighting changed sections. Since this provides the complete
context of a change, it is especially useful for understanding or reviewing
changes before committing them to the repository.
The external format type invokes a user-defined
command to display the output.
Command-line Options
The wdiff command can also invoke any of these formats,
including calling tkdiff or other external difference tool. To cause wdiff to
call tkdiff, invoke as wdiff -Ptkdiff. This works even on non-Windows
system if you've installed the public domain tkdiff tool.
For additional information, please refer to the on-line help
for the Difference Options dialog and to the
wdiff manual
page. |