Search Unity

[Version Control] Trying to save in a locked scene aborts the entire save process

Discussion in 'Editor & General Support' started by JohanF_TF, Dec 10, 2015.

  1. JohanF_TF

    JohanF_TF

    Joined:
    May 20, 2015
    Posts:
    75
    Hey alll

    Don't know if Perforce behvaes the same way, I'm trying to figure out if the problem is with Unity, or the version control plugin.

    We've started using exclusive checkouts (locking) in our Unity project, where we lock things such as materials, scenes, prefabs.

    However, we've noticed that there are instances where files are not saved to disc properly, and therefore not getting checked in properly. This seems to happen when you have a scene open, that is locked by someone else, edit your assets, and save. Since the scene you're currently in fails to check out and save, it appears as if it aborts the save process altogether, resulting in your other work not being saved as well. If you open another scene that you're allowed to edit, and press save, the changes are committed properly to the file and you can submit your changes.

    It does NOT seem to happen when you check in using the Version Control window inside Unity, so I guess that it does some explicit saving when checking in. I think it only happens if you check in using the Plastic GUI, since it does not know of the changes stored in Unity, but not yet saved to disc.

    Reproduction:
    1. Open a scene, exclusively checked out by someone else.
    2. Check out some other objects, e.g. materials, and make changes.
    3. Try to save, you will get an error in the console saving, for example

    PlasticSCM : These items are exclusively checked out by:
    /Assets/MergeTest 1/Test.unity (wk:wkSpace owner:johan)

    UnityEditor.AssetModificationProcessorInternal:OnWillSaveAssets(String[], String[]&, String[]&, Int32)

    and

    Could not check out the following files in version control before saving: Assets/MergeTest 1/Test.unity

    UnityEditor.AssetModificationProcessorInternal:OnWillSaveAssets(String[], String[]&, String[]&, Int32)

    4. Check in your changed assets from the Plastic SCM GUI
    5. Check the Branch Explorer, you'll see the files are not committed. Alternatively, update another workspace and check if the changes are there.

    Note: Again, it seems to work when checking in through the Unity Version Control window, but not the Plastic GUI.

    I think I understand the reason why it happens, but not sure who I'm supposed to go to with this: Codice or Unity? Or does the community have some clever way of going around this?