A colleague has created a perforce change list and has posted a review on review board for the change. Alas the change is not shelved, but I need to apply the change to my code. The colleague will not be available for some days so I can not ask him to shelve the files or to give me a unified diff of the files. So all I have now is the code review. From reviewboard I can download the perforce patch for the change. Please note this is not unified diff(like the output of p4 diff -du), but is some other format. Now my question is - is there a way I can apply this patch to another perforce client? Or maybe to convert the diff to unified diff so that I can use linux patch
command?
Can I apply changes from a perforce patch(downloaded from review board) to my code
1.2k views Asked by Ivaylo Strandjev At
1
It's fairly straightforward to apply a patch file downloaded from reviewboard on to a copy of the source code.
The only thing that you need to change is the path to the source code.
So, for example, given a downloaded patch file which has lines like:
You only need to change each line starting with
+++
.You can either change it to an absolute path to your source code or a relative path from some starting dir.
Then you combine that with judicious use of
-p
and potentially-d
and the patch file will apply.