perforceperforce-client-spec

How to sync perforce client to reduced p4 client specs?


I have a large perforce client already synced. I realized that I'll only be working on a sub directory of the larger root folder I synced to.

Old p4 client specs

//Depot/largeFolder/... //Clinet/largeFolder/...

New p4 client

//Depot/largeFolder/samllSubDir/... //Clinet/largeFolder/smallSubDir/...

Now when I perform a p4 sync perforce doesn't remove the other folders which I don't want in my client. I'm hesitant to do a p4 sync -f since I have files edited in the /largeFolder/smallSubDir/. I don't want them to get reset.

What is the right way to sync my client so that the other folders which are not in the new mapping are removed?

Note: My real mapping is complicated and deleting folders by hand is not realistic.


Solution

  • In the typical case, re-syncing a narrowed client will indeed remove the unmapped files. You don't say what happens when you try to do a sync (are there error messages?), so I can't say for certain what's going on, but these are the two first possibilities that come to mind:

    Useful commands to run if you're trying to debug (pick any file that's not getting [un]synced that you think should be):

    Note that the fact that opened files will not be touched by a p4 sync means that your edited files will be safe from a sync -f, provided that you actually opened them for edit. If you didn't, run a p4 reconcile and then p4 sync -f is perfectly safe -- but if you don't get to the root cause first (i.e. are the unwanted files also opened for edit?), it might not be helpful either.