Search Unity

Bug Provider.preSubmitCallback is not executing?

Discussion in 'Unity Version Control' started by SharpAccent, Mar 23, 2023.

  1. SharpAccent

    SharpAccent

    Joined:
    Jul 19, 2018
    Posts:
    39
    Hi
    To my understanding the .preSubmitCallback should have been called when someone is submitting a change in the version control right? However, it does not, I added also the .preCheckoutCallback but none are ever beeing called. the "registered" log is showing in the console however.

    What i'm trying to do is basically force delete some generated files before someone pushes on Plastic because they usually lock and cause trouble.

    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEditor.VersionControl;
    3. using UnityEngine;
    4.  
    5. public class PlasticCallbacks
    6. {
    7.     [RuntimeInitializeOnLoadMethod]
    8.     static void RegisterCallback()
    9.     {
    10.         Debug.Log("registered");
    11.         Provider.preSubmitCallback += MyPresubmitCallback;
    12.         Provider.preCheckoutCallback += MyPresubmitCallback;
    13.  
    14.      
    15.     }
    16.  
    17.  
    18.     static bool MyPresubmitCallback(AssetList list, ref string changesetId,ref string changesetDesc)
    19.     {
    20.         // Put your pre-submit code here
    21.         Debug.Log("plastic test");
    22.        
    23.  
    24.         return true;
    25.     }
    26.  
    27.  
    28. }
     
  2. ollieblanks

    ollieblanks

    Unity Technologies

    Joined:
    Aug 21, 2017
    Posts:
    460
    Hey @SharpAccent,

    Wouldn't an ignore.conf rule to cover these unnecessary additions be an easier solution?

    Hope this helps!
     
  3. SharpAccent

    SharpAccent

    Joined:
    Jul 19, 2018
    Posts:
    39
    YES but, we tried it already, the fmod_editor.log and their editorCache is notorious. It's always locking the pulls and we have to restart Unity, delete the files manually and open it again