Perforce 2003.2 Command Reference
<< Previous Chapter
p4 annotate
Table of Contents
Index
Perforce on the Web
Next Chapter >>
p4 branches

p4 branch

Synopsis

Create or edit a branch view specification.

Syntax

p4 [g-opts] branch [ -f ] branchspec
p4 [g-opts] branch -o branchspec
p4 [g-opts] branch -d [ -f ] branchspec
p4 [g-opts] branch -i [ -f ]

Description

p4 branch allows you to store a mapping between two sets of files for use with p4 integrate. This command displays a form: enter a view that expresses the mappings between the files you're integrating from (the fromFiles) and the files you're integrating to (the toFiles), specifying both sides of the view in depot syntax.

Once the branch specification has been created and named, you can integrate files by typing p4 integrate -b branchspecname; the branch specification automatically maps all toFiles to their corresponding fromFiles.

Completing p4 branch has no immediate effect on any files in the depot. Perforce doesn't create the branched files in the client workspace until you first call p4 integrate -b branchspecname.

Form Fields

Field Name
Type
Description

Branch:

read-only

The branch name, as provided on the command line.

Owner:

mandatory

The owner of the branch specification. By default, this will be set to the user who created the branch. This field is unimportant unless the Option: field value is locked.

Access:

read-only

The date the branch specification was last accessed.

Update:

read-only

The date the branch specification was last changed.

Options:

mandatory

Either unlocked (the default) or locked.

If locked, only the Owner: can modify the branch spec, and the spec can't be deleted until it is unlocked.

There is also an optional branch option: indirect.

An indirect branch implies p4 integrate -I for this branch; this allows p4 integrate to deal with files where the source and target files are not directly related by branching.

Description:

optional

A short description of the branch's purpose.

View:

mandatory

A set of mappings from one set of files in the depot (the source files) to another set of files in the depot (the target files). The view maps from one location in the depot to another; it can't refer to a client workspace.

For example, the branch view //depot/main/... //depot/r2.1/...

will map all the files under //depot/main to //depot/r2.1.

Options

-d

Delete the named branch specification. Files are not affected by this operation; only the stored mapping from one codeline to another is deleted. Normally, only the user who created the branch can use this flag.

-f

Force flag. Combined with -d, allows Perforce administrators to delete branches they don't own. Also allows administrators to change the modification date of the branch specification (the Update: field is writable when using the -f flag).

-i

Read the branch specification from standard input without invoking an editor.

-o

Write the branch specification to standard output without invoking an editor.

g-opts

See the Global Options section.

Usage Notes

Can File Arguments Use
Revision Specifier?

Can File Arguments Use
Revision Range?

Minimal Access Level Required

N/A

N/A

open

Branch views may contain multiple mappings. See the Views chapter for more information on specifying views.

Related Commands

To view a list of existing branch specifications

p4 branches

To copy changes from one set of files to another

p4 integrate

To view differences between two codelines

p4 diff2


Perforce 2003.2 Command Reference
<< Previous Chapter
p4 annotate
Table of Contents
Index
Perforce on the Web
Next Chapter >>
p4 branches
Please send comments and questions about this manual to [email protected].
Copyright 1999-2003 Perforce Software. All rights reserved.
Last updated: 12/12/03