perforceperforce-client-specperforce-stream

How to exclude a directory when syncing a p4 stream


I am using the command line tools of Perforce. And with the p4 tool, I want to sync to a stream.

The problem is that I want to exclude a directory from my workspace. If my work space was defined as a view, this would be possible with something like:

View:
    //depot/Foo/... //Client/Foo/...
    -//depot/Foo...bin/... //Client/Foo...bin/...

But the Stream: setting overrides the View: specification.

I have set the Stream using the command:

$ p4 client

I also looked into P4IGNORE mechanism, but this is of no use to my problem, as P4IGNORE will not influence the sync command.

I tried adding a Paths: command to my client spec, but that is not recognized in this context. I think it is used when specifying the stream, as done by the administrator of the depot?


Solution

  • This is exactly what virtual streams are for. :) Create a child of the stream with type virtual, and exclude the directory from the virtual child stream (via either Paths or Ignore in the stream spec). This will generate you a client view that is the desired subset of the parent stream.

    https://www.perforce.com/blog/virtual-streams-windows-big-projects