Patchwork [4,of,5,v2] histedit: prefer pick, edit message, and edit commit

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 23, 2015, 10:43 p.m.
Message ID <d7e9243f77436f6032d3.1450910593@waste.org>
Download mbox | patch
Permalink /patch/12333/
State Changes Requested
Delegated to: Augie Fackler
Headers show

Comments

timeless@mozdev.org - Dec. 23, 2015, 10:43 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1450905608 0
#      Wed Dec 23 21:20:08 2015 +0000
# Node ID d7e9243f77436f6032d32c73692c0646602e549b
# Parent  748533d83707f54a2d71026e4d54d428f38806e9
histedit: prefer pick, edit message, and edit commit

Selecting changesets, rewording commit messages, and
editing 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

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -222,7 +222,8 @@ 
     """ construct the editor comment
     The comment includes::
      - an intro
-     - short commands
+     - primary commands
+     - sorted short commands
 
     Commands are only included once.
     Internal commands (those beginning with `_`) are omitted.
@@ -235,14 +236,15 @@ 
 %s""")
     verbs = (
 "p, pick = %s" % _("use commit"),
+"m, mess = %s" % _("edit commit message without changing commit content"),
 "e, edit = %s" % _("use commit, but stop for amending"),
+
+"d, drop = %s" % _("remove commit from history"),
 "f, fold = %s" % _("use commit, but combine it with the one above"),
 "r, roll = %s" % _("like fold, but discard this commit's description"),
-"d, drop = %s" % _("remove commit from history"),
-"m, mess = %s" % _("edit commit message without changing commit content"),
 "",
 )
-    verbs = ''.join(["#  %s\n" % l for l in verbs])
+    verbs = ''.join(["#  %s\n" % l if l else '#\n' for l in verbs])
 
     return intro % (first, last, verbs)
 
diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t
--- a/tests/test-histedit-arguments.t
+++ b/tests/test-histedit-arguments.t
@@ -65,11 +65,11 @@ 
   #
   # Commands:
   #  p, pick = use commit
+  #  m, mess = edit commit message without changing commit content
   #  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.
@@ -283,11 +283,11 @@ 
   #
   # Commands:
   #  p, pick = use commit
+  #  m, mess = edit commit message without changing commit content
   #  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
diff --git a/tests/test-histedit-bookmark-motion.t b/tests/test-histedit-bookmark-motion.t
--- a/tests/test-histedit-bookmark-motion.t
+++ b/tests/test-histedit-bookmark-motion.t
@@ -71,11 +71,11 @@ 
   #
   # Commands:
   #  p, pick = use commit
+  #  m, mess = edit commit message without changing commit content
   #  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
@@ -131,11 +131,11 @@ 
   #
   # Commands:
   #  p, pick = use commit
+  #  m, mess = edit commit message without changing commit content
   #  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
diff --git a/tests/test-histedit-commute.t b/tests/test-histedit-commute.t
--- a/tests/test-histedit-commute.t
+++ b/tests/test-histedit-commute.t
@@ -65,11 +65,11 @@ 
   #
   # Commands:
   #  p, pick = use commit
+  #  m, mess = edit commit message without changing commit content
   #  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
@@ -330,11 +330,11 @@ 
   #
   # Commands:
   #  p, pick = use commit
+  #  m, mess = edit commit message without changing commit content
   #  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
diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t
--- a/tests/test-histedit-edit.t
+++ b/tests/test-histedit-edit.t
@@ -466,11 +466,11 @@ 
   #
   # Commands:
   #  p, fold = use commit
+  #  m, mess = edit commit message without changing commit content
   #  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
   #
 TODO: this abort shouldn't be required, but it is for now to leave the repo in
 a clean state.
diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -50,11 +50,11 @@ 
   #
   # Commands:
   #  p, pick = use commit
+  #  m, mess = edit commit message without changing commit content
   #  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
diff --git a/tests/test-histedit-outgoing.t b/tests/test-histedit-outgoing.t
--- a/tests/test-histedit-outgoing.t
+++ b/tests/test-histedit-outgoing.t
@@ -47,11 +47,11 @@ 
   #
   # Commands:
   #  p, pick = use commit
+  #  m, mess = edit commit message without changing commit content
   #  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 ..
 
@@ -78,11 +78,11 @@ 
   #
   # Commands:
   #  p, pick = use commit
+  #  m, mess = edit commit message without changing commit content
   #  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 ..
 
@@ -101,11 +101,11 @@ 
   #
   # Commands:
   #  p, pick = use commit
+  #  m, mess = edit commit message without changing commit content
   #  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