Asset Server Diff

I am guessing this is simple, but I’m pretty new to mac and unity alike. We have an asset server up and running, everything is great, but we tried testing how it handled text merge and I’ve gotten lost.

I had one guy commit his changes to a script file, then before I updated, added a little function in the area between where 3 of his new functions would go after update. Again, this was intentional to see how text merge went. Not surprisingly there was a conflict on that file. I tried to select the option to merge and Unity didn’t launch anything, but told me to “Accept” or “Cancel” the merge and told me to make sure I saved the merge in my merge tool. I didn’t have a merge tool - so I read the asset server guide, which linked me to SourceGear: DiffMerge, which I installed. The guide mentioned the compare feature, which required DiffMerge, so after installing diff merge I tried a compare, but unity didn’t launch anything - as if it didn’t find the app DiffMerge - which is actually a drive I had to mount, didn’t see an actual installer.

Lastly I went to unity’s preferences and saw a drop down for “Merge Tool” where I thought I should have been able to browse around and find DiffMerge, but Unity didn’t offer me any options in the drop down, it said “None” with a checkmark, no DiffMerge was listed, no Select… was listed, so I couldn’t set the merge tool!

What am I missing? How do I get Unity to launch DiffMerge on a text conflict?

Thanks in advance for any replies.

You have to set it in Unity - Settings - General. you can set the diff tool there.

Thanks for your quick reply, but thats what I had tried - Unity->Preferences(Didn’t see “Settings”)->General Tab. Had 3 drop downs available to me: External Script Editor, Image Application and File Diff Tool. For External Script Editor I was able to “Select…” then browse for an app, for Image Application it already listed Adobe Photoshop, and for File Diff Tool, it had selected None, but when I hit that drop down to see my options None is all that was listed, so I couldn’t browse for DiffMerge.

I’m thinking, since Unity recognized I had photoshop in the image editor drop down, it must not recognize that I have DiffMerge - perhaps I installed DiffMerge wrong? I’m used to downloading DMG’s which run installers, but when I downloaded DiffMerge it just mounted a DiffMerge 3.2 drive with the app and everything on it. Again, I’m pretty new to Mac, so maybe I need to actually install it on my drive somehow?

Sorry, Preferences naturally :sweat_smile:

you need to install the app.
thats pretty simple:

  1. App comes with installer → does it on its own
  2. App does not come with installer → in that case move the application into the applications folder (cmd-shift-a on the desktop for example)

Through moving it in the Applications folder it is installed.

I’m using Apple File Merge. as I never have actively installed it, I guess it came with xcode

That worked! Thanks. One day I’ll get a handle on this Mac.

On a similar note is there a way to specify a different merge tool? I would like to use beyond compare but all i have in the drop down is P4merge and Tortoise merge. Beyond compare is installed - would be nice to just be able to browse to it… anyone know how I might set that up?

Cheers,

A

:evil: I’ve P4Merge (Perforce P4 Merge) which works nicely for 2-way diff but when Unity tries to call it to manually merge with it I get an error like the image below.

:!: Also when I Update in Unity3D and have the choice Merge, Discard Server, Discard Local, I’d expect a double click to show a merge window instead of a diff window. Else how can I know what changes have been done on the server?

:!: Last but not least, I also prefer Beyond Compare 3. Would be nice to have support for it. BC3 supports 3-way merge (Pro only).

184710--6551--$p4merge_error_119.png

When is it planned to have Beyond Compare support or general Diff/Merge tool support?

If you are using Unity iPhone, you can customize it to support whatever diff tools you like at your own risk.

Here is how you can do it:
1.Select Unity iPhone.app on Finder
2.Right click and select “Show package”
3.Backup Contents/Tools/DiffTool.pl and edit as you like

I have recently customized my Unity iPhone to support Araxis Merge. I have not tested for all cases, but it seems to be working nicely.:wink:

I am attaching the file I edited, so if you are looking for Araxis Merge support, feel free to take it.
Just one quick note that paths for Araxis is dependent to my environment, so don’t forget to fix it to fit your environment.

#2010/4/19 updated:

  • fixed ploblem that 3 way merge not working properly

265052–10516–$difftoolpl_20100419_104.zip (2.4 KB)

i found way (read like “hack”) to use BC3 as comparing tools for Unity

  1. install WinMerge
  2. after install select it as comparer tool in unity
  3. go to install folder and replace (backup it first)
    WinMergeU.exe to my program
    there is simplest code c#
 class Program
    {
        static void Main(string[] args)
        {
            System.Diagnostics.Process MyProc = new System.Diagnostics.Process();
            MyProc.StartInfo.FileName =@"C:\Program Files (x86)\BC3\BCompare.exe";
            MyProc.StartInfo.Arguments = string.Format("\"{0}\" \"{1}\"", args[0], args[1]);
            MyProc.Start();
        }
    }

and now BC is my comparer tools AGAIN!

Nobody found a workaround for this problem ? Keeps bugging me in the beta 3 :evil:

Uploaded with ImageShack.us

It works, thx ZmeyNet:smile:

Ancient thread, still seems to be relevant though. :wink:

Thanks ZmeyNet for the Beyond Compare solution. I’ve improved it a bit to get it to work as a merge tool and carry over more flags (i.e. read-only).

using System;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        List<string> modArgs = new List<string>();
        int positional = 0;
        for (int i = 0; i < args.Length; ++i)
        {
            if (args[i] == "/dl")
            {
                modArgs.Add("/lefttitle=\"" + args[i + 1] + "\"");
                ++i;
            }
            else if (args[i] == "/dr")
            {
                modArgs.Add("/righttitle=\"" + args[i + 1] + "\"");
                ++i;
            }
            else if (args[i] == "/wl")
            {
                modArgs.Add("/leftreadonly");
            }
            else if (args[i] == "/wr")
            {
                modArgs.Add("/rightreadonly");
            }
            else if (args[i].StartsWith("/"))
            {
                // ignore all unrecognized parameters
            }
            else
            {
                ++positional;
                if (positional == 3)
                {
                    // third positional parameter is the output for a 2-way merge
                    modArgs.Add("/mergeoutput=\"" + args[i] + "\"");
                }
                else
                {
                    modArgs.Add("\"" + args[i] + "\"");
                }
            }
        }

        System.Diagnostics.Process MyProc = new System.Diagnostics.Process();
        MyProc.StartInfo.FileName =@"C:\Program Files (x86)\BC3\BCompare.exe";
        MyProc.StartInfo.Arguments = String.Join(" ", modArgs);
        MyProc.Start();
    }
}