[INDEX]

Why use branch views?

The relationship of a branch view to a set of branched files is a loose one. A branch view basically serves as a mapping specification which can be used for any p4 integrate command that names that view. However, while branch views are ephemeral, actual integration history is preserved forever.

Say I create a branch view called 'titan':

    Branch: titan
    View:
	//depot/main/...  //depot/project_titan/...
The branch view has no effect on any of the files in the depot. Whether or not I even use the branch view is a matter of choice. This particular view has such a simple mapping that I can skip the view and specify the mapping directly on the p4 integrate command:
    p4 integrate //depot/main/... //depot/project_titan/...
which does exactly the same thing as
    p4 integrate -b titan
Where branch views really prove useful is when mappings get complex. E.g., consider:
    Branch: neptune
    View:
	 //depot/main/server/...  //depot/project_neptune/server/...
	 //depot/rel2.0/tools/...  //depot/project_neptune/tools/...
	 //depot/rel3.1/qa/...  //depot/project_neptune/qa/...
This sets up a handy mapping for the 'neptune' development project. Using this branch view, you can merge all the changes you need into project_neptune using one command instead of three. That is, you can do:
    p4 integrate -b neptune
instead of:
    p4 integrate //depot/main/server/...  //depot/project_neptune/server/...
    p4 integrate //depot/rel2.0/tools/...  //depot/project_neptune/tools/...
    p4 integrate //depot/rel3.1/qa/...  //depot/project_neptune/qa/...
When you delete a branch view, you lose none of data about what changes got integrated from which file to which. What you lose is the shorthand for specifying that info. For example, if I do:
    p4 branch -d neptune
The 'neptune' branch view disappears from the Perforce database, but all the //depot/project_neptune files remain.

(April 1998)

[INDEX]
This is file $Id: //guest/universitytexas/faq/br07.html#1 $ in the Perforce Public Depot