Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Diff against multiple changelists with Perforce

I have some software that is version controlled with Perforce. There are a lot of checkins, and hence a lot of changelists.

There is one feature, implemented with many checkins across a long period of time, that I would like to port elsewhere. I can search the history by hand, but it would be really nice if there were a simple way to diff the current state of the baseline against the combined effect of selected changelists.

In other words, diff the latest-greatest in that branch against the result of: changelist A+ changelist B + changelist C...

How do I do this in Perforce?

like image 363
kmort Avatar asked Feb 19 '26 08:02

kmort


1 Answers

The way I would do this is to build up the set of changes I wanted in my workspace using a combination of p4 edit, sync, and resolve. The basic process would be:

  1. Sync to change A (assuming it starts the sequence)
  2. Open everything for edit
  3. Sync to change B-1 (this will schedule a resolve )
  4. Run p4 resolve and ignore the changes (-ay)
  5. Sync change B ( this will schedule a resolve )
  6. Resolve change B handling any conflicts
  7. Sync to change C-1
  8. Resolve and ignore the changes
  9. Sync change C
  10. Resolve and merge in the changes
  11. Diff against head
like image 193
Matt Avatar answered Feb 24 '26 15:02

Matt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!