Differences between revisions 1 and 7 (spanning 6 versions)
Revision 1 as of 2014-04-14 16:09:30
Size: 1217
Editor: JordiGH
Comment:
Revision 7 as of 2014-04-15 20:43:39
Size: 4179
Editor: Rain
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:

== Glossary ==

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

=== Command names ===

 * `evolve`: Automatically solve troubled commits. Get rid of `stabilize` and `solve` aliases?
 * `previous` and `next`: Move up and down the DAG. No more `gup` and `gdown` aliases?
 * `touch`: Create a new identical commit but identical to obsolete commit. Rename to `restore` and limit source to obsolete commits?
 * `prune`: Mark a commit as obsolete, optionally as replacing one. Remove `kill` and `obsolete` aliases.
 * `fold`: Fold various commits into one. Add a `squash` alias? Ok since git doesn't have a squash command.
 * `reorder`: Proposed command that permutes commits. With this proposed command, the Evolve UI completely replaces all uses of the histedit UI.

=== Concepts ===

 * '''Successor/precursor''': An obsolescence marker can indicate the commit that replaces the obsolete commit. The replacement is a successor, and the obsoleted commit is a precursor. These names are a bit ambiguous, because they sort of are synonyms for descendants and ancestors. Possible alternative language: '''replacement''' commit and '''original''' commit, with corresponding revset functions.

 * '''Troubled commits''': Commits that `hg evolve` will have to fix. There are three kinds of troubled commits:

   * '''Unstable''' commits: non-obsolete commits based on obsolete commits. If the obsolete commits have a replacement, unstable commits ought to be rebased to the replacemnt. If there is no replacement

   * '''Bumped''' commits: replacement commits whose original commit got turned into the public phase by a pull. Better terminology: '''invalidated''' replacements?

   * '''Divergent''' commits: Two conflicting replacement commits for the same original commit.

== Automatic "hg evolve" call ==

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

=== pros ===

 * Most (?) of the time, hg evolve will work without problems.
 * Nicer for the user for the magic to happen automatically by default

=== cons ===

 * Makes the user immediately handle instability
  /!\ This is a very serious downside. Currently, there is no way at all to cancel a merge conflict. Once you are in this state, you are stuck and have to do a serious biopsy.

  /!\ Agreed, we should absolutely not do this by default, nor have a config option. I'm ok with an hg commit --amend flag that does this for you automatically though. -- sid0

 * If you need to amend multiple changeset, you'd be stuck having to do multiple back-and-forth updates.
  /!\ This is also concerning. This is O(N^2) work rather than O(N) that incremental hg evolve runs allow. -- sid0

 * Letting the user decide when to deal with rebases and merge conflicts might be nicer.

Perhaps ui.autoevolve option? On by default? Off by default?
Line 15: Line 63:
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 certian 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 the number of revisions. 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.

/!\ 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

  • evolve: Automatically solve troubled commits. Get rid of stabilize and solve aliases?

  • previous and next: Move up and down the DAG. No more gup and gdown aliases?

  • touch: Create a new identical commit but identical to obsolete commit. Rename to restore and limit source to obsolete commits?

  • prune: Mark a commit as obsolete, optionally as replacing one. Remove kill and obsolete aliases.

  • fold: Fold various commits into one. Add a squash alias? Ok since git doesn't have a squash command.

  • reorder: Proposed command that permutes commits. With this proposed command, the Evolve UI completely replaces all uses of the histedit UI.

2. Concepts

  • Successor/precursor: An obsolescence marker can indicate the commit that replaces the obsolete commit. The replacement is a successor, and the obsoleted commit is a precursor. These names are a bit ambiguous, because they sort of are synonyms for descendants and ancestors. Possible alternative language: replacement commit and original commit, with corresponding revset functions.

  • Troubled commits: Commits that hg evolve will have to fix. There are three kinds of troubled commits:

    • Unstable commits: non-obsolete commits based on obsolete commits. If the obsolete commits have a replacement, unstable commits ought to be rebased to the replacemnt. If there is no replacement

    • Bumped commits: replacement commits whose original commit got turned into the public phase by a pull. Better terminology: invalidated replacements?

    • Divergent commits: Two conflicting replacement commits for the same original commit.

Automatic "hg evolve" call

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

1. pros

  • Most (?) of the time, hg evolve will work without problems.
  • Nicer for the user for the magic to happen automatically by default

2. cons

  • Makes the user immediately handle instability
    • /!\ This is a very serious downside. Currently, there is no way at all to cancel a merge conflict. Once you are in this state, you are stuck and have to do a serious biopsy.

      /!\ Agreed, we should absolutely not do this by default, nor have a config option. I'm ok with an hg commit --amend flag that does this for you automatically though. -- sid0

  • If you need to amend multiple changeset, you'd be stuck having to do multiple back-and-forth updates.
    • /!\ This is also concerning. This is O(N^2) work rather than O(N) that incremental hg evolve runs allow. -- sid0

  • Letting the user decide when to deal with rebases and merge conflicts might be nicer.

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

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:

  • strip
  • update
  • export

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?

CEDUserInterface (last edited 2021-10-20 08:05:10 by Pierre-YvesDavid)