/!\ This page is primarily intended for Mercurial developers

There are a number of things that have to be discussed about how the Evolve UI works.

Glossary

Which language should we use for Evolve? Remember that once this goes into core, this language gets frozen forever.

1. Command names

2. Concepts

3. Terminology Opinions

Ideally we're searching for a grammar where everything is related. If we have words that are closely associated in the English language, users will associate them with related version control tasks. It reduces the potential for confusion and increases the probability for knowledge recall. With that in mind, I'm not sure words like "evolve" and "troubled" go together well. You wouldn't think "this thing is troubled, therefore I'm going to evolve it." I would think "stablize" or "solve" would be much better verbs to complement "troubled." "This thing is troubled, therefore I'm going to stablize it" makes more sense, IMO. But I think there's still room for improvement in the grammar. --indygreg

Automatic "hg evolve" call

Many evolve commands produce unstable changesets. Should they immediately call hg evolve by default?

1. pros

2. cons

Perhaps ui.autoevolve option? On by default? Off by default?

I think auto evolve makes sense in some cases. For example, say you amend a commit with descendants and only change the commit message. Why wouldn't you want auto evolve in that scenario? -- indygreg

I think the "there are now troubled commits message" should be actionable. Currently it just prints the count of troubled commits. I'd really like to see a "run hg evolve to stablize" message. If we don't auto evolve, at least we can tell the user what they should probably be doing next. -- indygreg

hg fold

Currently fold can work in two modes: folding between a target revision and ".", or given an explicit set of revisions, fold this set into a single revision. The current UI for this is weird: for the first mode you specify revisions without --rev and the second mode you specify them with --rev. This UI is inconsistent with the rest of Mercurial. We have several examples of commands that take revisions with or without a --rev argument, and in all these cases, the behaviour is the same, and the --rev specifier is just optional:

Jordi has proposed patch to address this that treats revisions with and without --rev the same way and obtains both kinds of behaviours depending on whether a single or multiple revisions are specified. However, this has other problems. With certain revsets, it may not be easy to know in advance how many revisions are actually in the revset, so it would be surprising to get different behaviour depending on the number of revisions.

How to solve this?

Use Cases

1. Undoing an amend

Users will often accidentally amend a commit. Recovering from this right now involves looking at .hg/strip-backups, using incoming to find the bundle, hg unbundle, hg update, hg strip -k to delete the temp amend commit, hg bookmark to fix bookmarks, and hg strip again to delete the bad commit. In git it's just: git reset HEAD@{1}. We should be able to do something similar with evolve. Either a similar reset command, or perhaps an hg uncommit -r 'precursor(., 1)'

Pain Points

1. Evolve Steps can be Opaque

This is an attempt at creating a situation where the single-step 'hg evolve' behavior might be useful: amending two commits without calling 'hg evolve' inbetween. Start with a linear graph:

and amend 1 and 3 to create aa' and bb'. This gives us this graph:

Getting this repo back into an untroubled state takes 6 calls to 'hg evolve', the last 4 of which need --any.

When running the commands, it might not be clear to the user when to run 'hg evolve' and when to prefer 'hg evolve --any'. Running 'hg update' might also affect the results?

In other words: the steps needed to bring a repository back to an untroubled state feels completely opaque. This is an argument for having 'hg evolve' evolve all troubled changesets, in a similar way to how 'hg rebase' only lets you finish the rebase completely or abort it entirely.