Search code examples
perforcep4v

How to merge in P4 after a merge is messed up


So I did a merge through cmd which did not end up well, so I undid that CL (through visual client), now if I try to merge the 2 streams again I get a window saying Integration errors: //project_stream/main/... - all revision(s) already integrated. Does it mean there is no way to do the merge again?


Solution

  • If you undo an integration via p4 undo and the dm.integ.undo configurable is set you can just re-do an integration exactly as you tried to do.

    (p4 help undoc)
            dm.integ.undo            0 Enable re-integration of undone changes
    

    If those two conditions can't be met (i.e. you did the undo with a version of P4V that doesn't use the native undo command and/or you can't get your admin to flip that configurable setting), you have to re-integrate with the -f flag.

    The -f flag forces integration without regard to previous history, which allows you to redo an integration -- however, you need to explicitly tell it which revisions/changelists to integrate, and/or take extra care during the resolve process. Look carefully at the integration records from your original changelist to figure out what the earliest source changelist would have been, and do:

    p4 integ -f source/...@SOURCE_START,@now target/...
    

    The revision before SOURCE_START will be used as the base during the resolve process.