4. Invokation
● hg histedit <revision number>
– It will use commits from that revision onwards
● hg histedit –outgoing
– Use commits not yet commited (most useful, IMO)
5. Commit edition
The text editor associated to Mercurial will be opened with the
list of commits:
pick c561b4e977df Add beta
pick 030b686bedc4 Add gamma
pick 7c2fd3b9020c Add delta
# Edit history between c561b4e977df and 7c2fd3b9020c
#
# Commands:
# p, pick = use commit
# e, edit = use commit, but stop for amending
# f, fold = use commit, but fold into previous commit
# d, drop = remove commit from history
#
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
7. Commands
● pick
– Simply accepts the changeset as is. This is the
default action.
● fold
– Combines a changeset with the previous
changeset in the list and opens an editor to edit
the commit message.
8. Commands
● pick
– Simply accepts the changeset as is. This is the default action.
● fold
– Combines a changeset with the previous changeset in the list and
opens an editor to edit the commit message.
● drop
– Removes the changeset from history. Important: removing a
commit from history does not remove code changes. Use strip
or backout or any other tool for that.
9. Commands
● Edit
– Drops 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.