javamergeperforcechangelist

how to merge changelist into another branch using perforce java api


how to merge changelist into another branch using perforce java api. I have submitted some changes into a Perforce branch and a changelist created. Now I want to merge that changelist into another branches, using Perforce JAVA API.

I want to know if there is any method to merge single changelist into branch instead of merging files one by one using Perforce JAVA API.


Solution

  • Add the changelist to the IFileSpec that you use as the "from" for the integrateFiles() call.

    https://www.perforce.com/perforce/r15.1/manuals/p4java-javadoc/com/perforce/p4java/core/file/IFileSpec.html

    The equivalent from the p4 command line is doing:

    p4 integrate source/...@change,change target/...
    

    rather than:

    p4 integrate source/... target/...