How to remove files from depot without clobbering local versions with same name?
Posted 31 July 2019 - 03:22 AM
Someone accidentally submitted a changelist that included their Library/. I'd like to remove it from the depot, as nobody can sync now without clobbering their own Library/ and breaking the project. But the p4 operation to delete it wants to delete the copy in my workspace as well. That's not what I want - the whole goal is to retain the local workspace copy. Is there any way of doing this other than just letting it delete the Library and then allow Unity's asset processor to chunk through the Assets directory again and regenerate it? Or, can I roll back the state of the depot to before the changelist was submitted?
Brief context: the Unity game engine has an asset processor that imports and converts models, images, audio, scripts, etc into efficient internal format. It stores these as cryptic hashed blobs in a special directory called "Library" inside your project folder. It's non-portable and the project breaks if you copy it to another machine. Maybe it's serialized application state so very specific, I don't know exactly, but the main thing is that best practice is to never have it under version control.
Posted 31 July 2019 - 06:19 AM
When the files are obliterated, it's like they were never added to the depot at all; any workspaces that already include these files will "forget" that the files were in the depot and will treat them as unadded files. Obliterate is a dangerous command since it removes history and is not reversible, but in this case it's exactly what you want.
Files that should never be added to the depot should not have "write" permission in the protection table. You probably want to add a line to the protection table like:
write user * * -//depot/project/Library/...
to make sure that nobody can submit anything to that path.
If you're using streams, another way to do this is to exclude it from the mainline stream:
Paths: share ... exclude Library/...
Posted 02 August 2019 - 04:34 AM
Is there any way for a regular user to achieve this, like undoing their submitted changelist? (I don't have admin privileges, and we don't have an admin with much time to help with this so I'm trying to find ways of doing things as regular users as much as possible).
Along those lines, is there a way to set up excluding files without being admin, like a .gitignore?
Posted 02 August 2019 - 05:26 AM
The best way to exclude files from being added is to exclude them from your stream or client view. (If you're using streams, your client is automaticallyderived from a stream that you share with other users; if you're not using streams, everyone sets up their own client manually).
In streams, excluding a path looks something like:
Paths: share ... exclude Library/...
In a classic client view, it looks more like:
View: //project/... //my_client/... -//project/mainline/Library/... //my_client/mainline/Library/...
Posted 04 August 2019 - 01:54 PM
Yes, in my case, it's ok for everyone's local versions of these to be deleted and then they have to rebuild them, so the Undo method will be all right. The rebuild is automatic in Unity, and happens anyway when you do something like switch target platforms. It's just annoying because it can take a long time on large projects.
Posted 04 August 2019 - 03:57 PM
Yup! Note that * matches only a single directory (i.e. a string that does not include a slash); if you want to match at arbitrary levels of depth you can do:
//depot/... //my_client/... -//depot/.../Library/... //my_client/.../Library/... -//depot/....sln //my_client/....sln
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users