FlaShG / GitMerge-for-Unity

Unity plugin for merging sceneand prefabs files when using git.
GNU General Public License v2.0
201 stars 27 forks source link

Merged State but error when click Start merging the scene #52

Open jeffscm opened 8 years ago

jeffscm commented 8 years ago

After merging and conflicts are set I click the button "Start merging the scene" and get this error:

IOException: Assets/ContentPlayerFiles/my scenes/StarterLoader--OURS.unity already exists System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:115) System.IO.File.Copy (System.String sourceFileName, System.String destFileName) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:86) GitMerge.MergeManager.GetTheirVersionOf (System.String path) (at Assets/UnityMerge/GitMerge-for-Unity/Editor/MergeManager.cs:46) GitMerge.MergeManagerScene.InitializeMerge () (at Assets/UnityMerge/GitMerge-for-Unity/Editor/MergeManagerScene.cs:32) GitMerge.GitMergeWindow.OnGUISceneTab () (at Assets/UnityMerge/GitMerge-for-Unity/Editor/GitMergeWindow.cs:128) GitMerge.GitMergeWindow.OnGUI () (at Assets/UnityMerge/GitMerge-for-Unity/Editor/GitMergeWindow.cs:104) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Any hint how to solve this?

Aravind-Shankar commented 8 years ago

I'm also getting the same error with a trivial project. I just created two branches in my local machine and created a small conflict in the scene; then in MERGING state the button shows the same error when clicked, and that too repeatedly. In fact I get three different errors each time I click.

First error: ArgumentException: An element with the same key already exists in the dictionary. System.Collections.Generic.Dictionary2[System.Int32,UnityEngine.Object].Add (Int32 key, UnityEngine.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404) GitMerge.ObjectDictionaries.AddOurObject (UnityEngine.Object o) (at Assets/GitMerge-for-Unity-master/Editor/ObjectDictionaries.cs:68) GitMerge.ObjectDictionaries.SetAsOurObject (UnityEngine.GameObject go) (at Assets/GitMerge-for-Unity-master/Editor/ObjectDictionaries.cs:54) GitMerge.ObjectDictionaries.SetAsOurObjects (System.Collections.Generic.List1 objects) (at Assets/GitMerge-for-Unity-master/Editor/ObjectDictionaries.cs:36) GitMerge.MergeManagerScene.InitializeMerge () (at Assets/GitMerge-for-Unity-master/Editor/MergeManagerScene.cs:37) GitMerge.GitMergeWindow.OnGUISceneTab () (at Assets/GitMerge-for-Unity-master/Editor/GitMergeWindow.cs:128) GitMerge.GitMergeWindow.OnGUI () (at Assets/GitMerge-for-Unity-master/Editor/GitMergeWindow.cs:104) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Second error (on second click): IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path: System.IO.File.Move (System.String sourceFileName, System.String destFileName) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:337) GitMerge.MergeManager.GetTheirVersionOf (System.String path) (at Assets/GitMerge-for-Unity-master/Editor/MergeManager.cs:56) GitMerge.MergeManagerScene.InitializeMerge () (at Assets/GitMerge-for-Unity-master/Editor/MergeManagerScene.cs:32) GitMerge.GitMergeWindow.OnGUISceneTab () (at Assets/GitMerge-for-Unity-master/Editor/GitMergeWindow.cs:128) GitMerge.GitMergeWindow.OnGUI () (at Assets/GitMerge-for-Unity-master/Editor/GitMergeWindow.cs:104) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Third and final error, that repeats each time I click the button: IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path: System.IO.File.Move (System.String sourceFileName, System.String destFileName) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:337) GitMerge.MergeManager.GetTheirVersionOf (System.String path) (at Assets/GitMerge-for-Unity-master/Editor/MergeManager.cs:56) GitMerge.MergeManagerScene.InitializeMerge () (at Assets/GitMerge-for-Unity-master/Editor/MergeManagerScene.cs:32) GitMerge.GitMergeWindow.OnGUISceneTab () (at Assets/GitMerge-for-Unity-master/Editor/GitMergeWindow.cs:128) GitMerge.GitMergeWindow.OnGUI () (at Assets/GitMerge-for-Unity-master/Editor/GitMergeWindow.cs:104) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Aravind-Shankar commented 8 years ago

Sorry I copied the wrong log for the third error; this is the correct trace: IOException: Assets/Scenes\Main--OURS.unity already exists System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:115) System.IO.File.Copy (System.String sourceFileName, System.String destFileName) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:86) GitMerge.MergeManager.GetTheirVersionOf (System.String path) (at Assets/GitMerge-for-Unity-master/Editor/MergeManager.cs:46) GitMerge.MergeManagerScene.InitializeMerge () (at Assets/GitMerge-for-Unity-master/Editor/MergeManagerScene.cs:32) GitMerge.GitMergeWindow.OnGUISceneTab () (at Assets/GitMerge-for-Unity-master/Editor/GitMergeWindow.cs:128) GitMerge.GitMergeWindow.OnGUI () (at Assets/GitMerge-for-Unity-master/Editor/GitMergeWindow.cs:104) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Aravind-Shankar commented 8 years ago

The exact details about the conflict:

I created a scene with a "ground" plane and a sphere called "ball". I placed the sphere at (0,1,0) and made both ground and ball as prefabs. Then I created two branches rooted at that point. In the first I moved the ball to (3,1,0) and in the second I moved it to (-3,1,0). I applied the ball to the prefab in both cases and committed. Then I try git merge from the command line (from 1st branch I called git merge <2nd branch>), and as expected, it creates a conflict.

The prefab merging option worked flawlessly; I used the (0,1,0) position value to merge the ball prefab and it worked, no issues; git also reported that the merge was added to commit. But the scene merging button showed the errors that I posted.

Hope these details help in resolving the issue ASAP.

FlaShG commented 8 years ago

The project has not received any further attention from me ever since Unity 5 broke it in its roots. If you wish to continue development for what is working, please feel free to create a pull request.