Show TOC

DIFFLocate this document in the navigation structure

Use

Finds differences between two versions of a file. A version of a file is identified by the branch it belongs to and by its ordinal number on that branch, called the branch sequence number . Each branch is owned by one workspace. One workspace owns at most one branch. Thus a version in a version history is identified by a workspace plus a branch sequence number and the diff command uses exactly these two parameters to identify a version.

Syntax

Syntax

DIFF <folderItemPath@rev1> [-@rev2] [-w workspace1] [-w workspace2]

Arguments

<folderItemPath@rev1>

[-@rev2]

[-w workspace1]

Specifies the workspace if it is required to differentiate versions which are in other workspaces. The first workspace is associated with rev1 .

[-w workspace2]

The second workspace is associated with rev2 .

Description

Differentiates two versions of a file. The command takes the path(local or remote) as an argument. rev1 and rev2 should either be not specified or be valid branch sequence numbers or 0 .

If both rev1 and rev2 are specified, then a differentiation between rev1 and rev2 is displayed.

If only one of rev1 and rev2 is specified a differentiation between rev1/rev2 and the file on the local system is displayed.

If neither rev1 nor rev2 is specified then a diff between the active workspace version and the file on the local system will be shown.

If either rev1 or rev2 is specified as 0 then a differentiation between the version that was synchronized last is done with the other specified version.

If only rev1 or rev2 is specified as 0 then a differentiation between the version that was synchronized last is performed with the local file.

Example

Comparing Two Versions Using their Sequence Number

A file named a.java has three versions, all of which reside on the branch owned by the //test/dev workspace. In order to find differences between the version with branch sequence number 3 and the version with the branch sequence number 2 , execute the following command:

diff a.java@3 -@2

In this example, the workspace is not specified since our current folder is below the /test/dev workspace, which means that both versions will be taken from the branch owned by this workspace.

Comparing Two Versions Using their Sequence Number and Workspaces

In order to compare the version with branch sequence number 3 from the branch owned by the //test/dev workspace with the version with branch sequence number 2 from the branch owned by the //test/cons workspace, execute the following command:

diff a.java@3 -@2 -w //test/dev -w //test/cons

For more information about how to find versions, including their branches and branch sequence numbers that exist in the version history of a versioned object, see HISTORY .