Manage workspaces
This section discusses various approaches to managing your stream workspaces.
Using one workspace for multiple streams
When working with multiple streams, you have two choices:
- Switch one workspace between multiple streams; the workspace is appropriately populated whenever you switch from one stream to another. While this requires some extra processing, it is the right choice when you don’t need to work on different streams at the same time and you don’t want to have multiple streams on disk at the same time.
-
Establish a distinct workspace for each stream. This is the right choice if you want to move quickly between different streams or if you want to have multiple streams on disk at the same time.
Note that distinct workspaces must have distinct workspace roots — that is, distinct local folders.
To change the stream associated with a workspace, issue the following command:
p4 switch streamname
To get a workspace view and a set of files as of a specific changelist, issue the following command:
p4 switch stream@change
Narrowing the scope of workspaces with virtual streams
For large projects, even consistently-organized streams might not sufficiently restrict workspace views. In large organizations, there are often many groups who are concerned with only a small subset of a project’s files. In classic Helix Core Server, these users would manually restrict their workspace’s view to include only the desired subset. Streams offer an analog; use a virtual stream as a filter:
For example, if ongoing development work is occurring in an
//Ace/dev
stream:
Stream: //Ace/dev Parent: //Ace/main Type: development Paths: share ...
Then a user who is working only with the documentation for the product
(rather than all of the assets associated with the project) could create
a virtual stream that includes only those files under
//Ace/dev/docs/...
, as follows:
Stream: //Ace/devdocs Parent: //Ace/dev Type: virtual Paths: share docs/...
The user can then can switch his or her workspace to the
devdocs
virtual stream with the following command:
$ p4 switch //Ace/devdocs
When using the devdocs
workspace, the user’s workspace view
is automatically updated to include only the material in
//Ace/dev/docs/...
and any changes he or she makes in
//Ace/devdocs
are automatically made directly in the
original //Ace/dev
codeline without the need to manually run
p4 copy
or p4 merge
.
For details on virtual streams, see Virtual streams.