histedit: prefer edit commit, edit message, use commit
Selecting editing commits, rewording commit messages, and
selecting commits are key actions, we will prefer them more
generally in a future commit, this pulls them ahead before
that to make the diffs easier to read.
The remaining commands are left alphabetically sorted
--- a/hgext/histedit.py Wed Dec 23 21:17:45 2015 +0000
+++ b/hgext/histedit.py Wed Dec 23 21:20:08 2015 +0000
@@ -218,7 +218,8 @@
""" construct the editor comment
The comment includes::
- an intro
- - short commands
+ - sorted primary commands
+ - sorted short commands
Commands are only included once.
"""
@@ -229,12 +230,12 @@
Commands:""")
# i18n: command names and abbreviations must remain untranslated
verbs = _("""
+ e, edit = use commit, but stop for amending
+ m, mess = edit commit message without changing commit content
p, pick = use commit
- e, edit = use commit, but stop for amending
+ d, drop = remove commit from history
f, fold = use commit, but combine it with the one above
r, roll = like fold, but discard this commit's description
- d, drop = remove commit from history
- m, mess = edit commit message without changing commit content
""")
return ''.join(['# %s\n' % l if l else '#\n'
--- a/tests/test-histedit-arguments.t Wed Dec 23 21:17:45 2015 +0000
+++ b/tests/test-histedit-arguments.t Wed Dec 23 21:20:08 2015 +0000
@@ -64,12 +64,13 @@
# Commits are listed from least to most recent
#
# Commands:
+ #
+ # e, edit = use commit, but stop for amending
+ # m, mess = edit commit message without changing commit content
# p, pick = use commit
- # e, edit = use commit, but stop for amending
+ # d, drop = remove commit from history
# f, fold = use commit, but combine it with the one above
# r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit commit message without changing commit content
#
Run on a revision not ancestors of the current working directory.
@@ -293,12 +294,13 @@
# Commits are listed from least to most recent
#
# Commands:
+ #
+ # e, edit = use commit, but stop for amending
+ # m, mess = edit commit message without changing commit content
# p, pick = use commit
- # e, edit = use commit, but stop for amending
+ # d, drop = remove commit from history
# f, fold = use commit, but combine it with the one above
# r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit commit message without changing commit content
#
Test --continue with --keep
--- a/tests/test-histedit-bookmark-motion.t Wed Dec 23 21:17:45 2015 +0000
+++ b/tests/test-histedit-bookmark-motion.t Wed Dec 23 21:20:08 2015 +0000
@@ -70,12 +70,13 @@
# Commits are listed from least to most recent
#
# Commands:
+ #
+ # e, edit = use commit, but stop for amending
+ # m, mess = edit commit message without changing commit content
# p, pick = use commit
- # e, edit = use commit, but stop for amending
+ # d, drop = remove commit from history
# f, fold = use commit, but combine it with the one above
# r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit commit message without changing commit content
#
$ hg histedit 1 --commands - --verbose << EOF | grep histedit
> pick 177f92b77385 2 c
@@ -130,12 +131,13 @@
# Commits are listed from least to most recent
#
# Commands:
+ #
+ # e, edit = use commit, but stop for amending
+ # m, mess = edit commit message without changing commit content
# p, pick = use commit
- # e, edit = use commit, but stop for amending
+ # d, drop = remove commit from history
# f, fold = use commit, but combine it with the one above
# r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit commit message without changing commit content
#
$ hg histedit 1 --commands - --verbose << EOF | grep histedit
> pick b346ab9a313d 1 c
--- a/tests/test-histedit-commute.t Wed Dec 23 21:17:45 2015 +0000
+++ b/tests/test-histedit-commute.t Wed Dec 23 21:20:08 2015 +0000
@@ -64,12 +64,13 @@
# Commits are listed from least to most recent
#
# Commands:
+ #
+ # e, edit = use commit, but stop for amending
+ # m, mess = edit commit message without changing commit content
# p, pick = use commit
- # e, edit = use commit, but stop for amending
+ # d, drop = remove commit from history
# f, fold = use commit, but combine it with the one above
# r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit commit message without changing commit content
#
edit the history
@@ -342,12 +343,13 @@
# Commits are listed from least to most recent
#
# Commands:
+ #
+ # e, edit = use commit, but stop for amending
+ # m, mess = edit commit message without changing commit content
# p, pick = use commit
- # e, edit = use commit, but stop for amending
+ # d, drop = remove commit from history
# f, fold = use commit, but combine it with the one above
# r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit commit message without changing commit content
#
should also work if a commit message is missing
--- a/tests/test-histedit-edit.t Wed Dec 23 21:17:45 2015 +0000
+++ b/tests/test-histedit-edit.t Wed Dec 23 21:20:08 2015 +0000
@@ -469,10 +469,11 @@
# Commits are listed from least to most recent
#
# Commands:
+ #
+ # e, edit = use commit, but stop for amending
+ # m, mess = edit commit message without changing commit content
# p, fold = use commit
- # e, edit = use commit, but stop for amending
+ # d, drop = remove commit from history
# f, fold = use commit, but combine it with the one above
# r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit commit message without changing commit content
#
--- a/tests/test-histedit-obsolete.t Wed Dec 23 21:17:45 2015 +0000
+++ b/tests/test-histedit-obsolete.t Wed Dec 23 21:20:08 2015 +0000
@@ -49,12 +49,13 @@
# Commits are listed from least to most recent
#
# Commands:
+ #
+ # e, edit = use commit, but stop for amending
+ # m, mess = edit commit message without changing commit content
# p, pick = use commit
- # e, edit = use commit, but stop for amending
+ # d, drop = remove commit from history
# f, fold = use commit, but combine it with the one above
# r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit commit message without changing commit content
#
$ hg histedit 1 --commands - --verbose <<EOF | grep histedit
> pick 177f92b77385 2 c
--- a/tests/test-histedit-outgoing.t Wed Dec 23 21:17:45 2015 +0000
+++ b/tests/test-histedit-outgoing.t Wed Dec 23 21:20:08 2015 +0000
@@ -46,12 +46,13 @@
# Commits are listed from least to most recent
#
# Commands:
+ #
+ # e, edit = use commit, but stop for amending
+ # m, mess = edit commit message without changing commit content
# p, pick = use commit
- # e, edit = use commit, but stop for amending
+ # d, drop = remove commit from history
# f, fold = use commit, but combine it with the one above
# r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit commit message without changing commit content
#
$ cd ..
@@ -77,12 +78,13 @@
# Commits are listed from least to most recent
#
# Commands:
+ #
+ # e, edit = use commit, but stop for amending
+ # m, mess = edit commit message without changing commit content
# p, pick = use commit
- # e, edit = use commit, but stop for amending
+ # d, drop = remove commit from history
# f, fold = use commit, but combine it with the one above
# r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit commit message without changing commit content
#
$ cd ..
@@ -100,12 +102,13 @@
# Commits are listed from least to most recent
#
# Commands:
+ #
+ # e, edit = use commit, but stop for amending
+ # m, mess = edit commit message without changing commit content
# p, pick = use commit
- # e, edit = use commit, but stop for amending
+ # d, drop = remove commit from history
# f, fold = use commit, but combine it with the one above
# r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit commit message without changing commit content
#
test to check number of roots in outgoing revisions