andremussche/SemanticMergeDelphi

does not work with SemanticMerge 2.0

Opened this issue · 2 comments

Apparently the number of parameters has been changed after this tool was written. According to the SemanticMerge documentation https://users.semanticmerge.com/documentation/external-parsers/external-parsers-guide.shtml#TheexternalparserAPI SemanticMerge writes three lines per file to parse to stdin of the parser:

  • Inputfile
  • Encoding
  • Outputfile

The Encoding line seems to be new because pas2yaml writes its output to a files named like the encoding rather than the output file:

e.g.
inputfile.pas
UTF-8
outputfile.yaml

creates a file "UTF-8" in the current directory and the goes on to try and read the outputfile.yaml which of course fails.

This is dangerous because if more than one file is being passed (which is the rule!) it will take the second input file as the output file and overwrite it:

inputfile1
encoding1
outputfile1
inputfile2
encoding2
outputfile2

This will overwrite inputfile2 with the parsing output of outputfile1.

In the typical scenario the user will lose the second input file which is the one he just wanted to compare to the base file in the repository. And that's the file containing uncommitted changes.

I have cloned the repository and fixed the issue. It now works (and no longer overwrites files).
https://github.com/dummzeuch/pas2yaml
There are still some issues.