Jump to content

what is the method used to run configured external diff tools?


u2468

Recommended Posts

If I put the full path to a perl script and have the .pl extension set to run in windows (ie.  I just type the script name in a cmd window and it runs) put in as an external diff tool, then try to diff a file - it errors out saying "Error in diff tool 'C:\Users\joe\Desktop\myscript.pl'. Diff tools in client.conf are incorrectly defined."

 

However, just as a test, if I put notepad.exe in as a diff tool,  plastic will launch notepad when using the file diff.

 

So is there a restriction that the external diff tool has to be an exe file?

Link to comment
Share on other sites

Hello u2468,

 

I'm afraid your experiments are wrong.

 

For example, let's say I want to execute the following python "difftool":

import time
import datetime

ts = time.time()
st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
f = open('C:\\Users\\manu\\out.txt','a')
f.write(st + '\n') 
f.close()

Then we setup the diif tool as follows:

 

post-112-0-57096700-1424947249_thumb.png

 

We set it to the first position so it will be used for all the "text" type files.

 

post-112-0-84166100-1424947279_thumb.png

 

Then if I use the diff operation I get the timestamp written inside the out.txt file:

 

post-112-0-61360700-1424947327_thumb.png

 

This proves that you can use a non exe tool that is also non graphical for the diff tool. But I have to say that I prefer a graphical tool, I don't see the point of using a CLI diff tool.

 

Notice that if I want to run a python tool I need to execute "python.... blablabla". If I want to use a mono tool I need to run "mono... blablabla"

 

Which external diff tool are you trying to configure?

 

Link to comment
Share on other sites

I saw in your first post that it's a perl script. Did you include the "perl.exe" thing before "myscript.pl"?

 

Yes.  I had the full path to perl, then the full path to the script.  It didn't work. 

Then I wrote a C# command line app and it didn't work.

Then I wrote a C# windows GUI app and that did work.

 

I will try your example.

Link to comment
Share on other sites

Hi u2464, any update? can I help you somehow?

 

 

I confirmed that the scripts run in the background.  But I want the script to run in the foreground. 

Can you show me  the diff tool command line specification for  a python script that prints "hello world" to the terminal and stays open?

Link to comment
Share on other sites

Hi!

 

sure, look, here I have a python "hello world" program using pygtk. Every time I run a diff operation (Ctrl+D) I get the python window over Plastic SCM:

 

attachicon.gifpygtkHelloDiffTool.png

 

 

And this is how the diff tool is configured:

 

attachicon.gifhelloConfig.png

 

Oops, sorry I wasn't clear enough. 

 

Yes, I can get GUI programs to run.  

What I can't get running is a console program in the foreground.

 

So just a program that has:

print("hello world")

 

No GUI.

 

How to you make this run in the foreground so that you see the console with "hello world" and the console stays open.

Link to comment
Share on other sites

Just documenting for the benefit of other users. 

 

We were able to figure out that this can be done as follows:

 

cmd /c start c:\path2perl\bin\perl.ext c:\path2script\myperlscript.pl

 

It works!  The trick is: cmd /c start

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...