Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I share a workspace definition between multiple hosts?

I have created a Perforce workspace definition with which I will be able to "run the latest demo" on a PC.

Then I wanted to try and check out the same workspace on another PC in order to run the same demo. I found that I could not do this because the workspace is somehow tied to the first PC where I created it.

I ended up copying the workspace by

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  • inspecting the textual definition of the workspace and copying it to a text editor,
  • searching and replacing "WantedWorkspaceName" with "WantedWorkspaceName_NewHostname",
  • creating a new workspace with a new name ("WantedWorkspaceName_NewHostname"),
  • giving the new workspace the same workspace root path ("D:\Demo") as the original workspace,
  • pasting the modified textual representation into the textual representation of the new workspace.

Surely there must be a better way to achieve what I want? (Use the same workspace mapping on different hosts.)

>Solution :

Just use the -t template option to p4 client:

p4 client -t WantedWorkspaceName WantedWorkspaceName_NewHostname

You may also want to look at streams, which are an alternative way of setting up client/branch mappings. Rather than configuring each client individually, you define a single "stream" which encapsulates a set of depot mappings and branching relationships to other streams. Then a client can be defined simply in terms of what stream it’s associated with, and the views are auto-generated whenever the stream is changed.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading