Question

I'm trying to set up SemanticMerge as my diff tool for C# in Perforce.

I've configured perforce with the exe and with the arguments -s=%1 -d=%2 -l=csharp

diff tool settings

But when I try to diff a C# file I receive the error:

Could not find file c:\Program Files Perforce\%1

error message

The selected file is not in that location (nor is its filename %1)...

I am no doubt being slow and am trying to RTFM but am also hoping someone here can see what I'm missing

Was it helpful?

Solution

A user on twitter pointed me at a PDF which I can't believe I hadn't previously managed to find

http://www.semanticmerge.com/documents/SemanticMerge-Perforce.pdf

In short it's necessary to create a batch file to launch external diff and merge tools in Perforce.

OTHER TIPS

Using equal in the arguments -s=%1 -d=%2 will prevent the interpretation of %1 and %2 as file paths, hence your weird error. semanticmergetool also accepts arguments with space: -s "$LOCAL" -d "$REMOTE" and positional arguments: "$LOCAL" "$REMOTE", so you can set for instance:

Preferences > Diff > Default diff application: Other application
Location: .../semanticmerge/semanticmergetool.exe
Arguments: %1 %2

To set semanticmerge as merge tool, use Arguments: %1 %2 %b %r

Reference: https://users.semanticmerge.com/documentation/how-to-configure/semanticmerge-configuration-guide.shtml#HowtoconfigurewithPerforce

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top