Get only one folder from a stream depot in Perforce

Viewed 541

I am new to Perforce "stream depots" and stuck at step 1. I am trying to create a workspace that includes only one folder from a huge stream depot.

Every time I try, it seems to want to download the entire stream, which is a huge amount of files. I can see now way to limit it to just one folder.

2 Answers

This is what virtual streams are for.

Create a new stream that is a child of the stream in question, with type "virtual", and specify its Paths as the single folder, e.g.:

Stream: //streams/just_the_facts
Parent: //streams/main
Type: virtual
Paths:
    share path/to/the/facts/...

Now switch to that stream:

p4 switch just_the_facts

and you only have the files from the facts folder.

What I ended up doing was:

p4 set P4CLIENT=MyWorkspace then p4 client -s -S //My/Stream to create the workspace.

Then p4 sync //My/Stream/just/the/dir/I/want...

Related