Note:

This page is primarily intended for developers of Mercurial.

Good Ideas for Enhancements

Ideas that the community has discussed and largely approved of, but no one has yet implemented. This is somewhat distinct from Plan pages, although the two lists may overlap.

Projects listed here may be a good starting point for new contributors wanting to take on a more significant contribution than fixing "easy" bugs, without having to take on an up-front design discussion.

1. Expect Revset

expect(<set>, <int>) revset: fails if <set> isn’t exactly <int> elements

expect(<set>, <min>, <max>) revset: fails if <set> isn’t exactly between <min> and <max> inclusive

one(<set>) alias for expect(<set>, 1)

This then allows an alias for hg next to be update -r one(children(.)) with sane failure behavior, and also makes some other scripting tasks a little less difficult.

2. hg shellprompt

hg shellprompt bash "{branch} {node|shortest}": emits string for eval in bash to efficiently produce the specified template. Opens the door to first-part native prompt helpers that don’t have to start a Python. Prior art in docker’s command line tools?

Notes from the 4.4sprint on this topic:

3. Make `hg grep` do what people expect

See GrepPlan for details. Not a small project, but would be greatly appreciated by many users.

4. Make -S/--subrepos flags unnecessary

It has always been the intention to make commands like hg status, hg add, hg remove, etc. handle subrepos transparently. The way to go about that is outlined here; status of this work was being tracked on SubrepoWork.

5. Sensible merge diffs

Mercurial shows diffs against the first parent for all changesets, including merges, unless explicitly instructed to show the diff against the second parent. It would be better if we could show only the changes which were made to resolve conflicts. Unified diff by definition can only show the differences between a parent and a child revision, but both Git's merge diff and the now-unmaintained MergediffExtension extend this by adding a second column of +/- annotations on each line.

It's possible we could even do better, by showing only the changes that were made to resolve conflicts (something like a diff between the mechanical merge output and the actual committed code). This would save users from needing to learn to read an even more complicated format than unified diff.

6. See Also


CategoryDeveloper CategoryNewFeatures