p4 branch
Synopsis
Create or edit a branch mapping and its view.
Syntax
p4 [g-opts
] branch [-f] branchspec
p4 [g-opts
] branch -d [-f] branchspec
p4 [g-opts
] branch [-S stream
] [-P parent
] -o branchspec
p4 [g-opts
] branch -i [-f]
Description
p4 branch enables you to construct a mapping between
two sets of files for use with p4
integrate. A branch view defines
the relationship between the files you're integrating from (the
fromFiles
) and the files you're integrating to
(the toFiles
). Both sides of the view are
specified in depot syntax.
Once you have named and created a branch mapping, integrate files by
typing p4 integrate
-b branchname
; the branch mapping
automatically maps all toFiles
to their
corresponding fromFiles
.
Saving a p4 branch form has no immediate effect on any
files in the depot or your client workspace; you must call
p4 integrate -b
branchspecname
to create the
branched files in your workspace and to open the files in a changelist.
Form Fields
Field Name |
Type |
Description |
---|---|---|
|
read-only |
The branch name, as provided on the command line. |
|
mandatory |
The owner of the branch mapping. By default, this will be set to
the user who created the branch. This field is unimportant
unless the The specified owner does not have to be a Perforce user. You might want to use an arbitrary name if the user does not yet exist, or if you have deleted the user and need a placeholder until you can assign the spec to a new user. |
|
read-only |
The date the branch mapping was last accessed. |
|
read-only |
The date the branch mapping was last changed. |
|
mandatory |
Either
If |
|
optional |
A short description of the branch's purpose. |
|
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
maps all the files under |
Options
|
Delete the named branch mapping. 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 option. |
|
Force option. Combined with |
|
Read the branch mapping from standard input without invoking an editor. |
|
Write the branch mapping to standard output without invoking an editor. |
|
For a specified stream, display the mapping that is generated by
treating the stream as a child of the specified parent. Requires
|
|
Display the mapping generated for the specified stream. This option enables you to see how change is propagated between the stream and its parent. |
|
See “Global Options”. |
Usage Notes
Can File Arguments Use Revision Specifier? |
Can File Arguments Use Revision Range? |
Minimal Access Level Required |
---|---|---|
N/A |
N/A |
|
-
A branch view defines the relationship between two related codelines. For example, if the development files for a project are stored under
//depot/project/dev/...
, and you want to create a related codeline for the 2.0 release of the project under//depot/project/r2.0/...
, specify the branch view as://depot/project/dev/... //depot/project/r2.0/...
Branch views can contain multiple mappings. See “Views” for more information on specifying views.
-
If a path or file name contains spaces, use quotes around the path. For instance:
//depot/project/dev/... "//depot/project/release 2.0/..."
-
Branch views can also be used with p4 diff2 with the syntax p4 diff2 -b
branchname
fromFiles
. This will diff the files that match the patternfromFiles
against their correspondingtoFiles
as defined in the branch view.