Search Unity

Good SVN - Native SVN Support in Unity on Mac/Windows

Discussion in 'Assets and Asset Store' started by tgraupmann, Feb 10, 2013.

  1. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Even if you run a server on Amazon, your SVN client will checkout the initial project. You'll open Unity with that project and then everything you need to do at that point can happen from the panel.

    You at a minimum need to have a SVN server to use a SVN client. And we support the TortoiseSVN client.
     
  2. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    +1 for Cornerstone support ;_;
     
  3. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Hi, I just ran into an issue with Good SVN on my Mac. I'm hoping you maybe have a work around or can provide a fix.

    What I found is this: On a Mac, if the Unity project is not at the root of the svn repository (and the checkout does not include the entire repository tree), Good SVN is not able to trigger Crossover/TortoiseSVN (nothing happens when I click the Good SVN buttons).

    Good SVN works fine on Windows regardless of where the project is in the repository and it works fine on a Mac if the Unity project is at the root of the repository.

    Here's some background:

    I have a repository where I'm keeping a master collection of assets and sample projects. The tree looks something like this:

    Assets
    -3D Models
    -Audio
    -Books
    -Unity Assets
    --(individual folders for each Unity Asset Demo project)
    -etc.

    I've tried doing the svn checkout at the "Unity Assets" folder and at the individual "Unity Asset Demo" project. Both ways, Good SVN does not work. I suspect it would work if I did the checkout at the root of the repository but I don't have enough space on my Mac do to that test.

    I tried creating a new repository and copying just one asset demo project to the root of that repository. That worked fine with Good SVN on my Mac.

    I don't want to have individual repositories for each of my asset demo projects. I can live without Good SVN for these types of projects because I can use the Mac based SVN client that I use for the initial checkout. But it would be nice if I could get Good SVN to work.

    Let me know if you have any questions or suggestions.
     
  4. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Good call. Yes you have to have the project initially checked out in SVN before Good SVN can work.

    Although there is no restriction to needing to work in the root of the repository.

    I use several subfolders with out 30 unity projects within that and it works.

    On Mac we definitely need to enable External->Checkout.

    The trick will be understanding that within Unity checking out a new project should usually be done to a clean folder.

    In the future you'll GoodSVN->External->Checkout and checkout to a clean folder. And then File->Open Project that folder as an existing project.

    You typically add your Assets and Project Settings folders. Never add the Library folder. And make sure visible meta files is enabled. Always check in the meta files.
     
  5. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Hi, Thanks for responding.

    I always do an initial checkout with a Mac svn client. I use SmartSVN by Wandisco because that was the only Mac client I could find (at the time) that supported svn 1.8.

    But on my Mac, I need to check out the entire repo for Good SVN to work. If I do the checkout on a subfolder of the repo, Good SVN will not work. Literally, nothing happens when I click the buttons in the Good SVN panel.

    On Windows, this problem does not exist.

    It's not an issue of working in the root of the repository. It's that I don't have the root checked out. Not only am I working in a sub folder, the initial check out is from a sub folder.

    I understand if this is an unavoidable limitation of Good SVN on Mac. It's just that, in this case, it's a hassle for me to checkout my entire "Assets" repo to my Mac.

    If you can't resolve this, I'll just use the Mac client to manage svn for the projects in my Assets repo.

    All my main projects have their own repositories. In those cases, I have the entire repo checked out and Good SVN on Mac works just fine.

    I already have the relevant project settings and ignore list on my blog.
     
  6. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Is there any update on my issue of GoodSVN not working on Mac unless the repo root is checked out?
     
  7. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Sorry not yet. That's how I use it. I put the folder under version control right after the Unity project is created. And then I use the versioning tools in a panel in the editor.
     
  8. Exis

    Exis

    Joined:
    Jan 27, 2014
    Posts:
    14
    Does this work in Unity 5?
     
  9. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    It works for me with Unity 5 on Windows.

    For OSX, as per my above comments, the project needs to be in the root of the repo.
     
  10. agentc0re

    agentc0re

    Joined:
    Feb 28, 2014
    Posts:
    77
    Is this project yet updated to work with Unity 5.3.6 or 5.4?
     
  11. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    This package should be compatible with any 5.X version.
     
  12. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    It works and I still use it. Tested on Unity 5.3.6 and 5.4.

    It does not work on OSX unless your project is in the root of the repo.

    It is annoying (but not a showstopper) that every time I import it to a project I get a warning that the code needs to be auto upgraded because it uses obsolete APIs.

    I own over 200 assets (maybe over 300) and this is literally the only one that was not quickly updated by the developer to reflect the Unity 5 API changes. It would be trivial to update the asset to remove the warning.

    In my collection there are perhaps 2 or 3 assets that conflict with this one due to method name overlaps. Since GoodSVN is an asset meant to be used on every project, it would be nice if the code was organised into its own namespace so as to avoid such conflicts.
     
    Last edited: Aug 18, 2016
  13. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Thanks for the feature request. Yes a namespace is definitely a good idea. And sorry about those upgrade warnings. The upgrade process for packages is a bit wonky for Unity. It would be nice if the API stayed the same but just deprecated API methods so things remain 100% forward compatible. Instead APIs are changed and there's built-in upgrade/import scripts. At least there's a warning toggle in the console so you don't have to see them. And we need to add some #if UNITY_5 checks to the code and republish with Unity 3.X if that's still possible.
     
  14. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    I'm starting to see this error in some of my Unity projects that I've upgraded to 5.40f3:

    get_dataPath is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'GoodSVNPanel'.
    See "Script Serialization" page in the Unity Manual for further details.
    UnityEngine.Application:get_dataPath()
    GoodSVNPanel:.cctor()
    UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)
     
    quping likes this.
  15. quping

    quping

    Joined:
    Aug 18, 2016
    Posts:
    3
    I also encountered such a problem
     
  16. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    To be fair, the issue only happens once and doesn't prevent going into play mode.
     
  17. quping

    quping

    Joined:
    Aug 18, 2016
    Posts:
    3
    Yes, but it is always a problem
     
    schmosef likes this.
  18. quping

    quping

    Joined:
    Aug 18, 2016
    Posts:
    3
    The problem solved。


    //private static string s_lastExternalPath = Application.dataPath; // THB 2016/08/19

    private static string s_lastExternalPath;

    #region ENABLE / DISABLE
    private void OnEnable()
    {
    s_lastExternalPath = Application.dataPath;

    minSize = new Vector2(103, 18);
    if (!prefsLoaded)
    {
    LoadPrefs();
    }
    }
     
    schmosef likes this.
  19. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852