accurev diff -v <ver-spec-1> -V
<ver-spec-2> [ -cwWIB | -G ]
<element-specs>
accurev diff [ --mine | --theirs ] <element-specs>
accurev diff -v
<stream-spec> [ --mine | --theirs ]
<element-specs>
accurev diff -a [ --mine | --theirs ]
accurev diff -a -v
<stream-spec> [ --mine | --theirs ]
At the end of any diff command, you can add:
The diff command compares two versions of a file element, or a set of file elements. For certain forms of this command, the meaning of “version” is expanded to include a modified file that you have not yet preserved with the
keep command. For such a file, there is no official version object in the AccuRev repository.
... diff shows the changes you’ve made recently to a file — changes you’ve made since an
update of the workspace or a
keep of the file. More precisely, the default is to compare the file in your workspace tree (in the local file system) with the repository version in your workspace stream, as listed by the
stat or
files command:
The command diff -a -i -v -V is a very powerful tool for finding the differences between two streams. It processes just the elements that have different versions in the two streams. It indicates the “before” and “after” version-IDs, along with the content changes and namespace changes between the two versions.
The mergelist command also shows the differences between two streams; but it doesn’t include the changes in the “source” stream that have already been propagated to the “destination” stream. See the
mergelist reference page for a fuller explanation.
•
|
AC_DIFF_CLI: An environment variable used by diff to invoke an alternative file-comparison program. (The default file-comparison program is acdiff in the AccuRev bin directory.) The command string should include these substitution patterns:
|
%1% or
%1 — filename of the first version to be compared
%2% or
%2 — filename of the second version to be compared
%3% or
%3 — title to be displayed for the first version
%4% or
%4 — title to be displayed for the second version
The values that AccuRev substitutes for the %3% and
%4% patterns are
not enclosed in double-quotes, even though the values typically include
SPACE characters. The values that AccuRev substitutes for the
%1% and
%2% patterns
are enclosed in double-quotes.
•
|
ACCUREV_DIFF_FLAGS: Stores the options to pass through to the file-comparison program used by the diff command. If you use - - to specify these options while issuing the diff command, this environment variable is ignored.
|
File intro.doc along with all files in the current directory with names such as
chap02.doc or
chap17.doc.
If you use the -b -v combination,
-b indicates the version in the stream, P, that is the parent of the stream specified with
-v. If
-v specifies a time-based stream, then
diff uses the version that was in stream P at the basis time, not the version currently in stream P.
Same meaning as -v. Use along with
-v to specify the second version to be compared. If you are comparing a stream between two transactions, the versions used with
-v and
-V must be the same.
-t <transaction-1-transaction-2>
The basis version corresponding to the other specified version. See the
patch reference page for a description of the basis version.
Common cases: If the first version was created in a workspace with keep, the
-1 option selects the version on which it was based (the predecessor version), which may or may not have been created in the same workspace. If the first version was created in a dynamic stream with
promote, the
-1 option selects the version that was in the first version’s stream just prior to the promotion.
Compare the specified version (X) with the version in
X’s stream’s backing stream. (Use
-v -V instead if comparing elements of type
text that are active in a time-based stream.)
Any items on the command line following the double-dash (--) are passed through to the program that performs the actual file comparison. Typically, each of these flags also starts with a dash (for example,
-c -i -w). They can be specified on the command line, or stored in the
ACCUREV_DIFF_FLAGS environment variable.
Use the UNIX diff command to show the difference between the current contents of file
foo.c and the most recently kept version:
> export AC_DIFF_CLI="diff %1 %2" (tell AccuRev which diff command to use)
> accurev diff foo.c -- -i -b
(the -i and -b options tell the UNIX diff command to
ignore case differences and space changes)
diff returns 0 for no differences, 1 for differences, or 2 for an error.