Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the diff chunks without p4 resolve

I want to design a shell script that will take the resolve decision based on the diff chunks shown by 'p4 resolve'

The current state of my script is something like -

p4 integ -b @=CL #This will open the files in my default CL.

p4 resolve #It will now resolve the files opened in my default CL one by one

Now my Problem is, with p4 resolve, I cannot redirect its output to some file and or read the diff chunks because, it shows diff chunks for one file and waits for the user input for resolve decision. I want the script to take the very obvious resolve decision.

So, is there any way to find the diff chunks for the files in my default CL? So that, I can read these diff chunks anyhow and make these obvious resolve decisions?

like image 751
Manish Sharma Avatar asked Oct 03 '22 07:10

Manish Sharma


1 Answers

I wanted to do something similar; output the actual conflicts in a Jenkins job so that the information could be sent to the relevant development engineer.

I noticed the handy p4-dump-conficts script by jwd, based on that, perhaps the following is enough

echo -e "d\ns\n" | P4EDITOR=cat p4 resolve

(i.e. get p4 resolve to (d)iff and then (s)kip and use cat to output the results. This works for all 'pending' files in the workspace)

like image 105
Mark Robinson Avatar answered Oct 07 '22 18:10

Mark Robinson