perforceperforce-integrate

Get a list of changelists that have not been integrated into a particular branch


If I have Branch A and Branch B. Branch B was branched from Branch A. Periodically, we integrate changes from Branch B back into Branch A. Is there a p4 command for listing the Branch B changelists that have not yet been integrated into Branch A? I can think of some reasons that this may not be possible given that a changelist's files is not necessarily limited to a single branch, but I'm hoping for the best here.

I have found this question: Is it possible to list the changelists that have been integrated to a workspace?

... which is the opposite of what, I want but makes it clear that there are ways to do this using multiple commands. I can think of a couple of ways to use multiple commands to get what I want, but before I go down that road I'd like to make sure there's no simple way to do this.


Solution

  • You want to use the 'interchanges' command. It's currently unsupported (as of release 10.2), but 'p4 help interchanges' will get you the command line usage for the tool (it is currently only available on the command line). I don't recall specifically what version this command was introduced.

    p4 interchanges -b mybranch
    

    Will report on unintegrated changes as defined by the branch spec. Use the '-r' as you would with 'p4 integ' to reverse the branch mapping. Filespecs can also be given on the command line if you don't have a branch spec:

    p4 interchanges //depot/main/... //depot/RelA/...
    

    Will report on unintegrated changes from main to RelA

    As with any undocumented/unsupported feature, you need to be careful with the output. There may be some situations that cause inaccurate information to be returned. My experience with this command however, has been great. The command is briefly described in the book "Practical Perforce" by Laura Wingerd. My point being that this command is likely to see its way into general help very soon.

    Hope this helps.