Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hi,
I am interested to see the difference between two revisions of project file. In order to decide whether to include it in my next release. I tried using si diff -r 1.31 -r 1.33 "TemporalFileForTesting.bcm" command from command-line.
Showing differences ...
TemporalFileForTesting.bcm
"TemporalFileForTesting.bcm": Differences between Revision 1.31 and Revision 1.33
si: "diff": Unable to invoke command: Unknown error
I received the above error since I don't have toolkit installed in my pc.
Hence I like to know if there are ways to find the difference between the two revisions of a project file.
what happens if you do
si diff --gui -r 1.31 -r 1.33 "TemporalFileForTesting.bcm"
instead?
Hi Mr.Klaus Thierer,
Yes, It is possible to use the command si diff -g -r 1.31 -r 1.33 "TemporalFileForTesting.bcm". It shows the difference in MKS Visual Difference Tool which I don't want to have as I run all the SI commands in Batch mode. Hence I want the difference in file to be captured in a variable.
For me it seems that 'si diff' in this context expects an external tool that can be called by 'diff'.
That mean it will call the first executable it finds within the search paths of the Path-Variable
that matches the pattern (diff.exe/bat)
You could try to mimic what 'si diff' does with the following approach
>si projectco --nolock -r 1.31 --targetFile=.PTCTMP\1.31@TemporalFileForTesting.bcm TemporalFileForTesting.bcm
>si projectco --nolock -r 1.32 --targetFile=.PTCTMP\1.32@TemporalFileForTesting.bcm TemporalFileForTesting.bcm
>your_diff_tool .PTCTMP\1.31@TemporalFileForTesting.bcm .PTCTMP\1.32@TemporalFileForTesting.bcm
You would still have to install/download an own diff tool though (maybe something from the GNU collection).
Or the dirty way
diff.bat (at best in the first directory of the path variable) |
---|
REM show the command line that 'si diff ...' generated echo CMD: %0 %* REM call the command with parameters (%*) "c:\my_local_copy_of_Toolkit\mksnt\diff.exe" %* |
In the end I would say just install that toolkit, and if you dont like what Toolkit does to your system Variables (path ...)
just delete all Toolkit specific, and prepend the directory ...\Toolkit\mksnt to the path variable in your batch file or command windows.
BTW:
I don't know if there is somewhere but,
I feel that for command line users there should exist a recommandation that the directory ...\Toolkit\mksnt should be the very first entry of the (system) path variable.
Regards Jürgen
Hello Vikkram Ravi,
This is addressed in our knowledgebase by CS130649: Integrity CLI Command "si diff" Fails With Error Message "Unable to invoke command: Unknown error": as of Integrity 10.7, the diff command used for command line operations is internal to the Integrity code.
You can get to the search interface by going to the eSupport Portal. Choosing the Integrity tab will filter the results to only include Integrity products. I used the search text "si diff fails" to find the article as the top hit.
Kind Regards,
Kael
Just a question:
Is the PTC-MKS-Toolkit then discontinued starting from 10.7 or does it just loose the external character and is
fully incorporated into Integrity?
Hello Klaus Thierer,
Neither? Only a subset of Toolkit was included with the Integrity client (I'm going from memory, but I believe it was diff and fgrep that were basically included). When the remaining Toolkit components were removed, I believe it was because that functionality was fully included in the Integrity binary, to remove Toolkit as a dependency.
Kind Regards,
Kael
... what about using DOS command for difference COMP.EXE within a batch script?
The command to compare two files is (the echo is needed as comp asks for comparison of other files):
echo N | comp file1 file2 >nul 2>&1
Checking the errorlevel will show if different (errorlevel 0 means identical, errorlevel 1 means different, other errorlevel means error)