Note:

This page is primarily intended for developers of Mercurial.

Merge Info Plan

1. What is this trying to solve?

Conflicts can be hard to understand because, often, the user lacks context about what is going on.

This page is the plan to introduce a new command hg mergeinfo to solve this problem by displaying contextual information about the merge state and conflicts.

Thanks to the use of this command, the user will be able to understand the conflicts better and know how to resolve them the right way.

2. What should be displayed?

High level view of what is going on

hg mergeinfo could display an overview of the ongoing process: rebase / amend / evolve ..., where we stopped in the process and why

For each conflict: what changesets introduced the versions of the files that are conflicting

Let's assume that we are rebasing a stack of commits (a_1, a_2 ... a_n) into another stack of commits (x_1, x_2, x_3 ..., x_m).

Let's assume that applying a_1 create conflicts because it changed a file, k, also changed in x_4 and no other changeset above x_4.

Then the user will see conflicts marker between a_1 and x_m (with m != 4 assuming that there are more than 4 commits in the stack).

This information is not very useful for the user that would probably want to know that x_4 introduced the change in k and not only that the change is in x_m.

More useful would be that for each conflict we would show what changeset introduced the version of the files that we are comparing (there can be multiple changesets).

3. When should this be displayed?

The resolve command seems like a good place to add this hg resolve --info FILE seems appropriate. (alternatively we could have a standalone command hg mergeinfo but seems harder to discover)

Additionally, the merge info output could be displayed by other commands when a conflict occurs.


CategoryDeveloper CategoryNewFeatures

MergeInfoPlan (last edited 2015-12-03 04:53:37 by Pierre-YvesDavid)