JohnyJ

In trying WinMerge as my external merge application I'm using the following arguments:
/e /x /s /ub /dl %6 /dr %7 %1 %2 %4

But when I merge my changes into either side, save, and exit out of WinMerge (to return to Visual Studio) I get a message saying "The manual merge for <filename> has been canceled"

At the same time if I merge from the left ("Theirs") to the right ("Yours"), save and then refresh WinMerge I get a message saying "Another application has updated file <filename> since WinMerge scanned it last time. If you want to refresh files close current file compare and load files again."

Any ideas


Re: Team Foundation Server - General WinMerge as external merge application

CRathjen - MSFT

The first one is a problem with the exit code; it sounds like WinMerge isn't returning 0 even though you successfully completed the merge.

You can verify this by running the merge yourself (invoking WinMerge from a command line) and, after it exits, type "echo %errorlevel%" to see what WinMerge exited with.

If I'm right, you may be able to work around this with a well-crafted command file (pass in all arguments to WinMerge, then examine the exit code and return 0 from the cmd file if WinMerge's exit code is their success code); then configure this cmd file as the tool instead of WinMerge itself.

I'm not sure what's going on with the second case - I'll get the real experts to take a look at this thread.






Re: Team Foundation Server - General WinMerge as external merge application

JohnyJ

I tried what you suggested. In two ways. First I made some temp text files and then compared those via the command line. %errorlevel% returned 0. I then tried using the temp files that are created by VS when doing a merge (as I was doing a merge); made my changes, saved, closed and again %errorlevel% was 0 but VS still gave me the same error.

I tried merging using kdiff3 and that seems to work just fine, guessing now this is a WinMerge issue




Re: Team Foundation Server - General WinMerge as external merge application

Richard Berg MSFT

My guess is WinMerge is saving your changes into the left/right file itself instead of into the "output" file.




Re: Team Foundation Server - General WinMerge as external merge application

JohnyJ

The output file does get generated, the temp files for left and right do not change (according to the timestamp). I just noticed that the message I get whenever I refresh in WinMerge says the output file has been modified by another application, not the left/right files.




Re: Team Foundation Server - General WinMerge as external merge application

JohnyJ

Hmmm can anyone tell me what TFS expects in the merge How the three files are used Does it put a lock on the left/right temp files when merging Does it just look for a success code from whatever application is doing the merge

Thanks for all your help!




Re: Team Foundation Server - General WinMerge as external merge application

CRathjen - MSFT

As far as I know, we look for the presence/absence of the specified output file, and the exit code.




Re: Team Foundation Server - General WinMerge as external merge application

Paul Oliver

I was able to get this to work by creating a command file (saved as c:\program files\winmerge\winmergeFromTFS.cmd)

@rem winmergeFromTFS.cmd

@rem 2007-08-01
@rem File created by Paul Oliver to get Winmerge to play nicely with TFS
@rem
@rem To use, tell TFS to use this command as the merge command
@rem And then set this as your arguments:
@rem %6 %7 %1 %2 %4

"C:\Program Files\WinMerge\WinMerge.exe" /ub /wl /dl %1 /dr %2 %3 %4 %5
exit 0

Then, from TFS, I point to the CMD file above as my merge tool, and then the arguments are:

%6 %7 %1 %2 %4

Hope this helps,

Paul