Jump to content

Edited Workspace mappings pulling old files

  • Please log in to reply
3 replies to this topic

#1 Maffew



  • Members
  • Pip
  • 3 posts

Posted 28 October 2019 - 02:44 PM


I have been using P4V for version control for some time now and have my workspace mappings set up so that P4V pulls a main project and a project template. The template is then shared across multiple projects.

//depot/Project01/... //Matt_WorkspaceName/Project01/...
+//depot/Templates/TemplateV1/... //Matt_WorkspaceName/Project01/TemplateV1/...

//depot/Project02/... //Matt_WorkspaceName/Project02/...
+//depot/Templates/TemplateV1/... //Matt_WorkspaceName/Project02/TemplateV1/...

//depot/Project03/... //Matt_WorkspaceName/Project03/...
+//depot/Templates/TemplateV1/... //Matt_WorkspaceName/Project03/TemplateV1/...

This was working perfectly until I tried to upgrade Project01 to TemplateV2.
I changed my workspace mapping to

//depot/Project01/... //Matt_WorkspaceName/Project01/...
+//depot/Templates/TemplateV2/... //Matt_WorkspaceName/Project01/TemplateV2/...

I then deleted the v1 folder in windows file explorer and tried to pull v2.

Initially I got the error

h:\Project01\TemplateV2\...#head - file(s) not in client view

So I manually created the TemplateV2 folder and tried again.

The log showed all of the TemplateV1 files being deleted.
I restored the files from a backup and edited my workspace mapping so that it didn't include the other 2 projects, just incase it deleted files that I needed from those projects.
I hit Get Latest on the entire depot and it still downloaded V1 files to all 3 projects.

My understanding was that if I removed the V1 mappings it wouldn't push or pull to those locations but this doesn't seem the case.
Does this have something to do with the + at the start of the mapping? I thought this necessary if the same depot location was being pulled to various workspace locations.

#2 Sambwise


    Advanced Member

  • Members
  • PipPipPip
  • 1003 posts

Posted 29 October 2019 - 05:18 AM

I think a few things have gone wrong here.  I'll go through all those and then see if I can figure out what you should do to get things in the state you want them to be in.

Plus mappings

I don't think these work the way you're trying to use them.  Plus mappings (or "overlay mappings") let you map multiple depot paths into a single client path, sort of smushing all the files together.  The thing you're trying to do (map a single depot path to multiple client paths) is accomplished by ampersand mappings (or "ditto mappings"), which create multiple copies of a single depot path on the client.

Changing a client view

When you change the client view, just do a normal sync operation to update the workspace.  The client view is the source of truth for what the workspace should contain; deleting the local folder won't change the client view, it'll just confuse the server about what it's synced to your workspace and what it hasn't.

Careful with obfuscated paths when you're getting tech support

Some of the things you've described don't line up with each other (for example, the "not in client view" error doesn't match the client view you said you set up, and I also don't think that the view you described with the plus mappings would have ever worked), so I'm guessing some path names have been changed to protect the innocent.  Be careful when you obfuscate paths for someone else's benefit this that you "translate" the paths in a consistent way!

Okay, now to try to get things into the state you want them in.  Taking your original client view as given, I think this is the client view you want:

//depot/Project01/...             //Matt_WorkspaceName/Project01/...
//depot/Templates/TemplateV2/...  //Matt_WorkspaceName/Project01/TemplateV2/...
//depot/Project02/...             //Matt_WorkspaceName/Project02/...
//depot/Templates/TemplateV1/...  //Matt_WorkspaceName/Project02/TemplateV1/...
//depot/Project03/...             //Matt_WorkspaceName/Project03/...
&//depot/Templates/TemplateV1/... //Matt_WorkspaceName/Project03/TemplateV1/...

Once you've set this to be your client view, just do a normal sync -- don't delete folders from your workspace manually.  If the client view is set up wrong and a sync doesn't put things how they're supposed to be, you need to fix the client view rather than just trying to fix the workspace files after the fact.

#3 Maffew



  • Members
  • Pip
  • 3 posts

Posted 29 October 2019 - 11:11 AM

Thanks for the reply.
Ditto mappings sounds like what I'm looking for. I tried the new mappings using an ampersand instead of a plus, but I get the following error

Error at line 6 of field 'View' in client specification.
Null directory (//) not allowed in '&//depot/Templates/TemplateV1/...'.

Also, the documentation states


Mapping lines prepended with & are read-only, so in the example above //bruno_ws/documentation/logo.png and //bruno_ws/support/logo.png are read only.

Would this mean that any changes I made in Project03 wouldn't be submitted?

#4 Sambwise


    Advanced Member

  • Members
  • PipPipPip
  • 1003 posts

Posted 29 October 2019 - 02:34 PM

The error means that your server version isn't current enough to support ditto mappings (these were added somewhere around 2016.2, I think).  If you don't have a server that supports that feature, your better option is to have a workspace per project, so that you can have the same depot files in each project without having to have multiple copies of them in the same workspace.

The read-only property on ditto mappings would only apply to the specific path you've mapped that way, so it'd apply to the "template" files but not the others.  (Again, if you have a workspace per project this isn't an issue.)

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users