perforce

How to get source branch from a pending cherrypick CL?


I am trying to find a source branch of a CL being cherrypicked.

I have the following scenario: One CL containd same changes to 3 branches: A, B, C. Someone cherrypicked it to branch D. Obviously when they were doing the cherrypick process, they had to put in a source branch and a target branch, possibly as a branch mapping. However, when another user is given the pending CL number, how can they work out which of the branches A, B or C was used for cherrypicking? Where is the information about branch mapping stored? Is there any command in p4 to obtain it?

I need this information before the pending CL is submitted.

I have checked Perforce documentations, but I haven't found anything helpful. P4 describe command shows only target branch.


Solution

  • Use p4 resolved and/or p4 resolve -n to view the source of a pending integration.

    If you're on another client, do p4 -H otherHost -c otherClient resolved to see resolved integrations for the owning client.

    If the change is shelved, you can unshelve it (p4 unshelve -s CHANGE) and then run p4 resolved in your own client, or you can use p4 fstat -e CHANGE -Rs -Or //... to see all shelved files in that changelist and their associated resolve records.

    Note that this does not in itself tell you exactly what branch mapping was used (just the individual files), but in practice it's not usually hard to infer the branch mapping based on the paths of the individual files.