Differences between revisions 5 and 7 (spanning 2 versions)
Revision 5 as of 2009-05-19 19:31:00
Size: 594
Editor: localhost
Comment: converted to 1.6 markup
Revision 7 as of 2009-07-18 23:40:36
Size: 2735
Comment: Expand on the usage docs.
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
It allows selecting (pick), combining (fold), rejecting (drop) or modifying (edit) already commited changesets.
Line 29: Line 31:
See http://bitbucket.org/durin42/histedit/src/tip/README The extension adds the {{{histedit}}} command which takes a {{{revision}}} argument. All changesets from that revision onwards are selected for history reordering and modification. They are presented as an ordered list with a changeset revision preceded by an action keyword for each line ({{{action revision-id}}}), like this:
Line 31: Line 33:
If you were to run {{{hg histedit c561b4e977df}}} for a repo with this history graph:
{{{
 @ 3[tip] 7c2fd3b9020c 2009-04-27 18:04 -0500 durin42
 | Add delta
 |
 o 2 030b686bedc4 2009-04-27 18:04 -0500 durin42
 | Add gamma
 |
 o 1 c561b4e977df 2009-04-27 18:04 -0500 durin42
 | Add beta
 |
 o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42
      Add alpha
}}}
Line 32: Line 48:
it would show

{{{
 pick 030b686bedc4 Add gamma
 pick c561b4e977df Add beta
 fold 7c2fd3b9020c Add delta
}}}

History rewriting works by reordering those changesets, so they reflect a new ordering in the history graph, or by changing the desired action to take on each changeset. The possible actions are one of:{{{pick}}}, {{{fold}}}, {{{edit}}} or {{{drop}}}

{{{pick}}} - it's the default action and simply accepts the changeset as is
{{{fold}}} - combines a changeset with the previous changeset in the list and opens an editor to edit the commit message
{{{edit}}} - will drop to the command prompt, allowing to edit files freely to commit some changes as a separate
commit. When done, any remaining uncommitted changes will be committed as well. When done, run {{{hg histedit --continue}}} to finish this step or {{{hg histedit --abort}}} to abandon the new changes and keep the previous state.
{{{drop}}} - will remove the changeset from history

When changes lead to conflicts then the user is dropped to the command prompt and has the very same options as when the {{{edit}}} action is selected. To accept new changes the {{{hg histedit --continue}}} options is used and to drop them the {{{hg histedit --abort}}} one.

See http://bitbucket.org/durin42/histedit/src/tip/README for a more detailed explanation
Line 33: Line 68:
CategoryExtension CategoryExtensionsByOthers

Histedit Extension

This extension is not distributed with Mercurial.

Author: Augie Fackler

Download site:

Home page: http://bitbucket.org/durin42/histedit/

Works with: Mercurial 1.2 and beyond.

1. Overview

History editing plugin for Mercurial, heavily inspired by git rebase --interactive.

It allows selecting (pick), combining (fold), rejecting (drop) or modifying (edit) already commited changesets.

2. Configuration

Configure your .hgrc to enable the extension by adding following lines:

[extensions]
histedit = 

3. Usage Scenario

The extension adds the histedit command which takes a revision argument. All changesets from that revision onwards are selected for history reordering and modification. They are presented as an ordered list with a changeset revision preceded by an action keyword for each line (action revision-id), like this:

If you were to run hg histedit c561b4e977df for a repo with this history graph:

 @  3[tip]   7c2fd3b9020c   2009-04-27 18:04 -0500   durin42
 |    Add delta
 |
 o  2   030b686bedc4   2009-04-27 18:04 -0500   durin42
 |    Add gamma
 |
 o  1   c561b4e977df   2009-04-27 18:04 -0500   durin42
 |    Add beta
 |
 o  0   d8d2fcd0e319   2009-04-27 18:04 -0500   durin42
      Add alpha

it would show

 pick 030b686bedc4 Add gamma
 pick c561b4e977df Add beta
 fold 7c2fd3b9020c Add delta

History rewriting works by reordering those changesets, so they reflect a new ordering in the history graph, or by changing the desired action to take on each changeset. The possible actions are one of:pick, fold, edit or drop

pick - it's the default action and simply accepts the changeset as is fold - combines a changeset with the previous changeset in the list and opens an editor to edit the commit message edit - will drop to the command prompt, allowing to edit files freely to commit some changes as a separate commit. When done, any remaining uncommitted changes will be committed as well. When done, run hg histedit --continue to finish this step or hg histedit --abort to abandon the new changes and keep the previous state. drop - will remove the changeset from history

When changes lead to conflicts then the user is dropped to the command prompt and has the very same options as when the edit action is selected. To accept new changes the hg histedit --continue options is used and to drop them the hg histedit --abort one.

See http://bitbucket.org/durin42/histedit/src/tip/README for a more detailed explanation


CategoryExtensionsByOthers

HisteditExtension (last edited 2021-02-01 14:07:53 by muxator)