Smart Merge not working

I have Unity 5 set up with Mercurial (TortoiseHg) and BitBucket. I followed all the instructions to set up Smart Merge so that scenes and prefabs could merge correctly (my co-developer did the same, and we’ve both re-checked to make sure the config was right).

Merging conflicting changes fails every time though. If we both edit the same prefab and try to merge our commits, we get an error, “Couldn’t load spec file ‘auto’.” We’ve tried both Mixed and Force Text modes for asset serialization, same result either way.

Does anyone have any info on this? Since it’s such a new tool, I couldn’t find any other threads on it anywhere…

The same happens with Tortoise SVN. I added the following extension specific merge program for “.prefab”.

C:\Program Files\Unity\Editor\Data\Tools\UnityYAMLMerge.exe merge -p %base %theirs %mine %merged

But trying to edit conflicts results in the “Couldn’t load spec file ‘auto’.” error.

I’m seeing the same thing with SourceTree.

I followed the instructions and put “merge -p $BASE $REMOTE $LOCAL $MERGED” as the arguments. When I try to ‘resolve conflict with external merge tool’, I see the error “Couldn’t load spec file ‘auto’”.

Looks like we hit the quadfecta. I also seem to be getting this error while using Perforce. Sometimes i am able to get around it by resetting up the connection by following the steps again, but i found another, unrelated problem as well.

In the 5.0.1 patch notes, there is this little line right here:

“Editor: Stripped prefab instance objects are now marked as stripped in the scene file…”

which now writes the word “stripped” next to the object identifier in the YAML.

because of this, the UnityYAMLMerge tool fails to parse the file, citing “mapping values are not allowed in this context.” I tested it out and manually deleted all the instances of “stripped” in the file and tried to run the tool on it again, and it did indeed work, but as you can imagine, it will be very tedious to remove every instance before submitting scene files, and just as hard to enforce across my team.

I’m also having issues with perforce, though my error is: “Error running semantic merge” when trying to resolve a scene file using the built in “Version Control Resolve” Unity prompt, selecting “Merging”, then selecting the “Semantic and merge tool” option.

If I select “Merge tool only” it thinks for a while, spawns the “Accept merge?” prompt, but never launches the merge tool I have specified in the preferences (p4merge). If I hit accept, it wipes the scene (lol!).

Is this the same workflow that everyone else is using? Honestly the SmartMerge documentation doesn’t say anything about how to actually perform the merges and resolve conflicts.

Bump. I know this wasn’t billed as a big feature, but it would be a big win for us if it just worked. With the blog post on the subject being the only source of information I’ve been able to find, I’m not really sure where to look next. Can anyone help?

Hi… Just got pointed to this thread. Let me verify the issue and get back to you asap.

Awesome, much appreciated. I’ll work on submitting a bug report and minimum repro right now – been meaning to anyway – and I’ll post the case # here.

Edit: So far it’s worked flawlessly in a fresh project, so I don’t think I can send you a minimum repro from that. If you need it, I can see if I’m allowed to make (and upload) a minimum repro from our actual project (NDAs and what-not). Unless someone else in this thread is able to get one to you based off their project.

We’ve been doing some more testing, and it looks like the “use semantic merge” button always produces an error of some type (on my coworker’s machine). I don’t actually even have the option presented to me on my machine anymore – it just spawns the “do you want to accept the merge?” window (as if I’d selected merge manually), followed by the merge tool I had selected (p4 merge). This is actually sort of good news; I wasn’t even getting that far before, and I was able at least to start trying to resolve “conflicts”.

In both cases, despite knowing exactly what we’d both changed and what the conflicts should have been, I saw 3 more conflicts than expected. I’m thinking these were all caused by plugins or something, because the data looked unfamiliar (“instanceID”; some other custom component gibberish buried underneath an ENORMOUS matrix of vector3s – argh!).

I can make a video of what we’re trying if that’d help.

TL;DR: We’re chocking this up from “Doesn’t work” to “works inconsistently.” We still aren’t quite sure what the perfect scenario is supposed to look like.

I have fixed the regression in 5.0.1 caused by the “stripped” keyword and will get it into a maintenance release of 5.0.

I will look into the “Couldn’t load spec file ‘auto’.” error next.

Fixed the “Couldn’t load spec file ‘auto’.” as well and it will also to a maintenance release of 5.0.

Thanks for the feedback so far.

I am getting the “mapping values are not allowed in this context” error in Unity 5.0.2

Would it be possible for you to send the base, mine and incoming files for me to reproduce?

Hello I’d like to ask about the UnityYAMLMerge - is it a feature exclusive to PRO version?
We’re using the Free (personal) version of unity 5 and Git versioning.
We have modified our Git config accoording to Unity - Manual: Smart merge, but there’s no way to enable smart merge for Git inside unity (you can enable it only on Perforce & Plastic SCM integration, which are PRO features)
When trying to run the UnityYAMLMerge.exe through command line it does not resolve a conflict (and just breaks the secene).

We’re very confused by this - is smartmerge a PRO feature and if so, how do you enable it for Git (inside unity)?
Thanks

No it is in Personal edition as well. When you buy pro you get the integrated (in editor gui) Perforce/PlasticSCM etc. support and UnityYAMLMerge is called automatically for you by this integration in case of conflicts.

When using Personal edition you setup your git config as the page you linked describes. If that breaks your scene it is a bug and I would very much like a copy of the three files being merged ie. base revision, local revision and incoming revision so I can fix it if possible.

Note that Unity 5.0.1 had a regression to the mergetool and is expected to break in some cases (an issue with stripped prefabs)… this will be fixed in an upcoming version.

Does this clearify things?

-Jonas

Oh wow. Thank you Google for randomly getting me this thread. I have been struggling with all this nasty collaboration stuff and am excited to see this working soon.

@jdrewsen Would you be willing to update this thread with the maintenance release containing these fixes? I try not to reinstall the entire editor unless it contains a fix I need.

I’ll do that yes.

Cool, cause the tool just isn’t working at all for us. We have the git config set up per the instructions on Unity’s docs and whenever we pull changes it just creates merge conflicts. Is the smart merge going to work for scenes or just prefabs? We always get scene conflicts on the most basic of changes.

sorry to necro this, but im still getting the “Couldn’t load spec file ‘auto’.” error when trying to use this tool.
Im using it with source tree on a mercurial repo and have it configured exactly like it mentions in the SmartMerg Manual.

I’m running unity 5.0.2 64bit on windows 7, tomorrow i will try on the same setup but on OSX once i arrive at work.

The fix is not yet in a maintenance release but in the upcoming 5.1 release. I will backport it to 5.0.x soon though.