So I have run into this a few times. Lets say I have WorkspaceA and I have sync'd to the latest CL (thousands of files, several hundred gb of data at least). Now I need to make a new workspace WorkspaceB pointing to a different depot but with identical data. How can I force WorkspaceB to recognize all of the existing data?
DepotA -> WorkspaceA -> MyPC (E:/Files)
In this initial config, WorkspaceA sees the connection between the files in E:/Files and the data from the Depot.
DepotA -> (Cloned) -> DepotB -> WorkspaceB -> MyPC (E:/Files)
In this config, WorkspaceB doesn't see that the Depot files in E:/Files are identical. Of course this makes sense, a fresh workspace has no metadata to connect everything. However, I have to assume there is a p4 command (ui or commandline) that will allow me to regenerate the metadata and search for all the existing files.
So my question is: How do I make WorkspaceB see the connection between DepotB and the files in E:/Files the same way that WorkspaceA sees the connection between DepotA and the files in E:/Files?
This is possible, but I would not recommend doing it exactly as you described. Having two workspaces pointing to the same files will inevitably cause issues, because if you make a change in one workspace, the server won't know that the change has been made in the other, so you'll constantly have issues of files getting stomped, or issues checking out, or many other things like that.
That said, the command you're looking for is p4 flush some studios will do something a bit similar to speed up creating new workspaces. Normally it would be done to create multiple workspaces pointing to the same depot/stream, like this:
Adapting that to your example would look something like this:
DepotA -> WorkspaceA -> MyPC (E:/WorkspaceA)
DepotA -> (Cloned) -> DepotB (using p4 populate
, most likely)
Copy files locally from E:/WorkspaceA
to E:/WorkspaceB
DepotB -> WorkspaceB -> MyPC (E:/WorkspaceB)
Then to tell the server to just assume everything is up to date, you can run p4 flush ...#head
This is an alias for p4 sync -k
read more in the documentation:
"Use p4 sync -k only when you need to update the have list to match the actual state of the client workspace."