This is an archive of the discontinued Mercurial Phabricator instance.

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

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

Details

Reviewers
baymax
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

Event Timeline

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.Feb 26 2019, 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.

Neat. I assume you normally check these out later?

Neat. I assume you normally check these out later?

For now yes. The plan was to make hg cat support cat-ing maultiple files preventing to checkout.

baymax requested changes to this revision.Jan 24 2020, 12:32 PM

There seems to have been no activities on this Diff for the past 3 Months.

By policy, we are automatically moving it out of the need-review state.

Please, move it back to need-review without hesitation if this diff should still be discussed.

:baymax:need-review-idle:

This revision now requires changes to proceed.Jan 24 2020, 12:32 PM