perforceperforce-stream

Perforce - Map a folder onto another location on the server


On perforce, we have a few projects all sharing the same 'framework' code. Right now we keep a copy of the framework under each project folder and merge between the projects. We considered keeping the framework in one folder and then mapping it onto each workspace. This would however require each developer to do it and might become messy. Is there a way to do this mapping server side so that anyone who takes a copy of a project will also get the framework folder?

We currently have

\\Project1\Source\Framework
\\Project2\Source\Framework

We would like to have

\\Project1\Source
\\Project2\Source
\\Framework

and somehow have each developer get Framework under each project's Source folder on her machine.


Solution

  • This is what streams are for. Make //Project1 and //Project2 stream depots, and then define streams that look like this:

    Stream: //Project1/Source
    Paths:
        share ...
        import Framework/... //Framework/...
    
    Stream: //Project2/Source
    Paths:
        share ...
        import Framework/... //Framework/...
    

    Clients associated with those streams will automatically get the mappings that you're looking for.