Share, Vote, & Discuss Ideas

We're constantly looking for new ways to improve our products and are asking you to help us by sharing your own ideas, voting for ideas you like, and discussing them with the rest of the community.

Add a non-interactive automerge switch to the P4Merge command-line

P4Merge has a very powerful automerge option, but unfortunately it only works in interactive scenarios. Being able to use this functionality in automated scenarios, such as Continuous Integration, would be great. Something similar to Beyond Compare's /automerge or Araxis' /merge. If automerge fails, do nothing and exit with a non-zero return code (don't open the visual merge window, that will defeat the point).

  • Ohad Schneider
  • Feb 23 2016
  • Attach files
  • Guest commented
    August 11, 2016 18:24

    There does exist this p4 command:

    p4 resolve -am

    From "p4 help resolve":

    The -am flag causes the workspace file to be replaced with the result
    of merging theirs with yours. If the merge detected conflicts, the
    file is left untouched and unresolved.

    I'll admit that I'm not sure whether p4 returns a non-zero code if any conflicts are detected, but it is certainly possible to work around this via "p4 fstat" and a small bit of custom scripting.