justrajdeep
justrajdeep

Reputation: 913

How to get the list of changelist already integrated?

There is interchanges command in perforce which lists changelists between two branches that have not been integrated with the convenience of a branchspec.

Is there something that shows the changelists that have been integrated something like the reverse of interchanges and also works with a branchspec?

More interested in terminal perforce rather than p4v.

Thanks

Upvotes: 1

Views: 1000

Answers (2)

Dom
Dom

Reputation: 90

Finding out if a changelist has been integrated into another branch in perforce is not simple. 'p4 interchanges' may not report everything as it relies on meta data and may 'think' that some changelists have been integrated.

Consider the case where CL10 was merged to branch B and then the changes were manually reverted via a 'p4 edit' instead of 'p4 undo' on B. Then if you run 'p4 integrate' with CL10 perforce returns with 'already integrated' message even though the code is no longer there (but might need to be).

Perhaps a solution to your question may involve combining ideas from Sam's answer above, 'p4 interchanges' and also running 'p4 integrate [-f]' within a loop to confirm that a set of changelists was indeed integrated. This is some work since the outputs of 'p4 resolve' and 'p4 diff/diff2' need to be considered.

My point is: do not solely rely on 'p4 interchanges'.

Upvotes: 0

Samwise
Samwise

Reputation: 71424

My recommended approach would be to do p4 changes on the source, run p4 interchanges between the source and target to get the source changes that have not been integrated, and diff the two to find the ones that have been integrated.

I'll also describe two other approaches that I would not recommend since they're a bit harder (but you might find elements of them useful):

  • Run p4 changes -i on the target and then run lots of p4 files commands to filter it down to the changes that originated on the source.
  • Run p4 integrated -b branch, run lots of p4 changes commands to convert the integration records into changelist ranges, and then sort them into a unified list.

Upvotes: 4

Related Questions