Diffing files and folders

To diff two files:

  1. In the depot pane, select the two files you want to diff.
  2. Context-click and choose Diff... The Diff dialog is displayed
  3. Specify the revisions of the files you want to diff and click Diff. P4V launches P4Merge, displaying the differences between the files at the specified revision.

Shortcut: drag the first file to the second file and drop it.

To diff two folders:

  1. In the depot pane, select the two folders you want to diff.
  2. Context-click and choose Diff... The Diff dialog is displayed
  3. Specify the revisions of the folders you want to diff and click Diff. P4V launches the folder diff utility, displaying the differences between the folders at the specified revision.

The resulting display is based on your current client view. In the case of added and deleted files, the folder diff utility displays the location where the files would reside if they existed.

To diff two folder revisions:

  1. Context-click the folder and choose Folder History.
  2. In the Folder History pane, click and drag one revision to the other. P4V launches the folder diff utility.

To diff two labels:

  1. In the depot pane, select the topmost meaningful path.
  2. Right-click and choose Diff... The Diff dialog is displayed.
  3. For each of the two Path fields, click Specify revision and specify the labels you want to diff.
  4. Click Diff. The folder diff utility displays the differences between the labels.

Diff dialog options

Checking workspace consistency

If you need to reconcile your workspace after working offline, see Working offline.

To detect common inconsistencies between the files in your workspace and those in the depot, you can diff your workspace with the server by selecting the folders of interest.

When diffing folders, the folder diff utility enables you to detect problems such as:

The folder diff utility also detects client view mapping disparities such as:

To prevent or correct disparities that arise from changes to your client view, retrieve the affected files (choose Get Latest Revision).

Viewing the state of the depot at a specified point in time

When you choose Specify revision, the corresponding pane displays the state of the depot at the specified date, changelist number, or label. This feature enables you to view the depot structure at that time without retrieving files, similar to P4Web's Back in Time Browsing.