-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: p4-plugin
-
None
-
Environment:Jenkins 2.504.3
P4 Plugin 1.17.2
windows 11
I believe 'diff' issue is that it is checking out the file we want to compare at given revision in depot in order to do a diff with local copy of the file, replacing our local copy of the file, instead of having a temp copy somewhere else.
This is what I did to run into the issue:
In Jenkins pipeline script, when running command:
def somefile = "valid_path_to_existing_file"
def somerev = valid_revision_number
def diffRes = p4.run('diff', somefile + '#' + somerev )
I got following error:
ERROR: P4: Task Exception: com.perforce.p4java.exception.ConnectionException: Unexpected exception in ClientSystemFileCommands.openFile: somefile(Access is denied)java.io.FileNotFoundException: somefile(Access is denied)
Running the same command in a cmd window give me the expected result.
[somefile]wasn't open for edit, therefore read-only. After using 'edit' command to open the file for edit and running the command again, I got the following result:
{rev=somerev, clientFile=path_on_disk_somefile, depotFile=depot_path_to_somefile, type=text}
So it seems that file on disk is equal to file#[somerev].
Running again the same command in cmd window now tells me that the 2 files are equal while its supposed to be different.
Leading me to think that we have checkout and modify our local file rather than compare it to depot file.
It seems that command 'diff2' suffers from the same issue.
Â
As mentioned, as a workaround for now, I can still run that command in a bat instruction in Jenkins and get expected result.