mergecommit: add a new extension to merge in-memory and create a commit
Needs ReviewPublic

Authored by pulkit on Sep 19 2018, 8:52 AM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

This patch adds a new mergecommit command which is very useful for workflows
where there is automated merging involved. This patch uses existing in-memory
merge API to merge in-memory and create a commit.

I was thinking about --commit flag to merge command, but then we need other
commitopts too, so created a new command.

This patches filemerge.py to not raise IMMConflictsError on first conflict
because we need a list of conflicts in the end.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped
pulkit created this revision.Sep 19 2018, 8:52 AM

Thinking about this more, I think I have not done a good job writing commit message. The extension is very useful when you have automation around merges or you do merges because of the following reasons:

  • The merge is done in-memory and is very fast if you disable the path conflicts auditing
  • You can specify a merge destination using --dest flag, which means you don't need to update to merge. You can merge two changesets from anywhere
  • You can parallelize multiple merges
  • This can be used as --dry-run for hg merge as it can tell whether a merge will result in conflicts or not without applying anything

That said, I am not sure if this looks like a good candidate for in-core extension. However, we want to share the work we have done on speeding up merge internally so that it can help other companies which uses merges. So, feel free to pick this up from here if you need this. :)

pulkit updated this revision to Diff 14248.Tue, Feb 26, 9:52 AM

I don't aim for this to get reviewed and pushed. This is here right now for sharing. We are using this extension internally for months now and has shown good results.