Click or drag to resize

BranchSpec Class

A branch view specification in a Perforce repository.
Inheritance Hierarchy
SystemObject
  Perforce.P4BranchSpec

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

The BranchSpec type exposes the following members.

Constructors
  NameDescription
Public methodBranchSpec
A branch view specification in a Perforce repository.
Public methodBranchSpec(String, String, DateTime, DateTime, String, Boolean, ViewMap, FormSpec, String)
A branch view specification in a Perforce repository.
Top
Properties
  NameDescription
Public propertyAccessed
The date of the last command used with this spec.
Public propertyDescription
A description of the branch spec (optional).
Public propertyId
The branch spec name (read only).
Public propertyLocked
When true, permits only the owner to change the spec.
Public propertyOptions Obsolete.
Flags to change the branch spec behavior.
Public propertyOwner
The user who created this branch spec. Can be changed.
Public propertySpec
Specifies structural and semantic metadata for form types.
Public propertyUpdated
The date this branch spec was last modified.
Public propertyViewMap
Lines mapping of one view of depot files to another.
Top
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFromBranchSpecCmdTaggedOutput
Read the fields from the tagged output of a branch command
Public methodFromBranchSpecsCmdTaggedOutput
Read the fields from the tagged output of a branches command
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodParse
Parse the fields from a branch specification
Public methodToString
Convert to specification in server format
(Overrides ObjectToString.)
Top
Remarks

p4 help branch

branch -- Create, modify, or delete a branch view specification

p4 branch [-f] name
p4 branch -d [-f] name
p4 branch [ -S stream ] [ -P parent ] -o name
p4 branch -i [-f]

A branch specification ('spec') is a named, user-defined mapping of
depot files to depot files. It can be used with most of the commands
that operate on two sets of files ('copy', 'merge', 'integrate',
'diff2', etc.)

Creating a branch spec does not branch files. To branch files, use
'p4 copy', with or without a branch spec.

The 'branch' command puts the branch spec into a temporary file and
invokes the editor configured by the environment variable $P4EDITOR.
Saving the file creates or modifies the branch spec.

The branch spec contains the following fields:

Branch: The branch spec name (read only).

Owner: The user who created this branch spec. Can be changed.

Update: The date this branch spec was last modified.

Access: The date of the last command used with this spec.

Description: A description of the branch spec (optional).

Options: Flags to change the branch spec behavior. The defaults
are marked with *.

locked Permits only the owner to change the spec.
unlocked * Prevents the branch spec from being deleted.

View: Lines mapping of one view of depot files to another.
Both the left and right-hand sides of the mappings refer
to the depot namespace. See 'p4 help views' for more on
view syntax.

New branch specs are created with a default view that maps all depot
files to themselves. This view must be changed before the branch
spec can be saved.

The -d flag deletes the named branch spec.

The -o flag writes the branch spec to standard output. The user's
editor is not invoked.

The -i flag causes a branch spec to be read from the standard input.
The user's editor is not invoked.

The -f flag enables a user with 'admin' privilege to delete the spec
or set the 'last modified' date. By default, specs can be deleted
only by their owner.

A branch spec can also be used to expose the internally generated
mapping of a stream to its parent. (See 'p4 help stream' and 'p4
help streamintro'.)

The -S stream flag will expose the internally generated mapping.
The -P flag may be used with -S to treat the stream as if it were a
child of a different parent. The -o flag is required with -S.

See Also