Click or drag to resize

DepotFileDiff Class

A diff between depot files in a Perforce repository.
Inheritance Hierarchy
SystemObject
  Perforce.P4DepotFileDiff

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2018.1.163.6632 (2018.1.163.6632)
Syntax
public class DepotFileDiff

The DepotFileDiff type exposes the following members.

Constructors
  NameDescription
Public methodDepotFileDiff
Initializes a new instance of the DepotFileDiff class
Public methodDepotFileDiff(DiffType, FileSpec, FileSpec, String)
Initializes a new instance of the DepotFileDiff class
Top
Properties
  NameDescription
Public propertyDiff
Public propertyLeftFile
Public propertyRightFile
Public propertyType
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFromGetDepotFileDiffsCmdTaggedOutput
Read the fields from the tagged output of a diff2 command
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

p4 help diff2

diff2 -- Compare one set of depot files to another

p4 diff2 [options] fromFile[rev] toFile[rev]
p4 diff2 [options] -b branch [[fromFile[rev]] toFile[rev]]
p4 diff2 [options] -S stream [-P parent] [[fromFile[rev]] toFile[rev]]

options: -d<flags> -Od -q -t -u

'p4 diff2' runs on the server to compare one set of depot files (the
'source') to another (the 'target'). Source and target file sets
can be specified on the 'p4 diff2' command line or through a branch
view.

With a branch view, fromFile and toFile are optional; fromFile limits
the scope of the source file set, and toFile limits the scope of the
target. If only one file argument is given, it is assumed to be
toFile.

fromFile and toFile can include revision specifiers; by default, the
head revisions are diffed. See 'p4 help revisions' for details
about specifying file revisions.

'p4 diff2' precedes each diffed file pair with a header line of the
following form:

==== source#rev (type) - target#rev (type) ==== summary

A source or target file shown as '<none>' means there is no file
at the specified name or revision to pair with its counterpart.
The summary status is one of the following: 'identical' means file
contents and types are identical, 'types' means file contents are
identical but the types are different, and 'content' means file
contents are different.

The -b flag makes 'p4 diff2' use a user-defined branch view. (See
'p4 help branch'.) The left side of the branch view is the source
and the right side is the target.

The -S flag makes 'p4 diff2' use a generated branch view that maps
a stream (or its underlying real stream) to its parent. -P can be
used to generate the branch view using a parent stream other than
the stream's actual parent.

The -d<flags> modify the output of diffs as follows:

-dn (RCS)
-dc[n] (context)
-ds (summary)
-du[n] (unified)
-db (ignore whitespace changes)
-dw (ignore whitespace)
-dl (ignore line endings).

The optional argument to -dc/-du specifies number of context lines.

The -Od flag limits output to files that differ.

The -q omits files that have identical content and types and
suppresses the actual diff for all files.

The -t flag forces 'p4 diff2' to diff binary files.

The -u flag uses the GNU diff -u format and displays only files
that differ. The file names and dates are in Perforce syntax, but
the output can be used by the patch program.

See Also