[PATCH] histedit: adds hint how to reorder changesets at editor (issue3766)

liscju piotr.listkiewicz at gmail.com
Tue Mar 1 23:05:31 UTC 2016


# HG changeset patch
# User liscju <piotr.listkiewicz at gmail.com>
# Date 1456872904 -3600
#      Tue Mar 01 23:55:04 2016 +0100
# Node ID dee0f04d72a02e8a30cfcbdd8d58b5a3d24b8f82
# Parent  c7f89ad87baef87f00c507545dfd4cc824bc3131
histedit: adds hint how to reorder changesets at editor (issue3766)

diff -r c7f89ad87bae -r dee0f04d72a0 hgext/histedit.py
--- a/hgext/histedit.py	Mon Feb 29 17:52:17 2016 -0600
+++ b/hgext/histedit.py	Tue Mar 01 23:55:04 2016 +0100
@@ -236,6 +236,7 @@ Commits are listed from least to most re
 
 Commands:
 """)
+    outro = _("You can also reorder the changesets by reordering the lines")
     actions = []
     def addverb(v):
         a = actiontable[v]
@@ -254,7 +255,8 @@ Commands:
     actions.append('')
 
     return ''.join(['# %s\n' % l if l else '#\n'
-                    for l in ((intro % (first, last)).split('\n')) + actions])
+                    for l in ((intro % (first, last)).split('\n')) +
+                                actions + [outro, '']])
 
 class histeditstate(object):
     def __init__(self, repo, parentctxnode=None, actions=None, keep=None,
diff -r c7f89ad87bae -r dee0f04d72a0 tests/test-histedit-arguments.t
--- a/tests/test-histedit-arguments.t	Mon Feb 29 17:52:17 2016 -0600
+++ b/tests/test-histedit-arguments.t	Tue Mar 01 23:55:04 2016 +0100
@@ -72,6 +72,8 @@ Run a dummy edit to make sure we get tip
   #  f, fold = use commit, but combine it with the one above
   #  r, roll = like fold, but discard this commit's description
   #
+  # You can also reorder the changesets by reordering the lines
+  #
 
 Run on a revision not ancestors of the current working directory.
 --------------------------------------------------------------------
@@ -304,6 +306,8 @@ Test that trimming description using mul
   #  f, fold = use commit, but combine it with the one above
   #  r, roll = like fold, but discard this commit's description
   #
+  # You can also reorder the changesets by reordering the lines
+  #
 
 Test --continue with --keep
 
diff -r c7f89ad87bae -r dee0f04d72a0 tests/test-histedit-bookmark-motion.t
--- a/tests/test-histedit-bookmark-motion.t	Mon Feb 29 17:52:17 2016 -0600
+++ b/tests/test-histedit-bookmark-motion.t	Tue Mar 01 23:55:04 2016 +0100
@@ -78,6 +78,8 @@
   #  f, fold = use commit, but combine it with the one above
   #  r, roll = like fold, but discard this commit's description
   #
+  # You can also reorder the changesets by reordering the lines
+  #
   $ hg histedit 1 --commands - --verbose << EOF | grep histedit
   > pick 177f92b77385 2 c
   > drop d2ae7f538514 1 b
@@ -139,6 +141,8 @@
   #  f, fold = use commit, but combine it with the one above
   #  r, roll = like fold, but discard this commit's description
   #
+  # You can also reorder the changesets by reordering the lines
+  #
   $ hg histedit 1 --commands - --verbose << EOF | grep histedit
   > pick b346ab9a313d 1 c
   > pick cacdfd884a93 3 f
diff -r c7f89ad87bae -r dee0f04d72a0 tests/test-histedit-commute.t
--- a/tests/test-histedit-commute.t	Mon Feb 29 17:52:17 2016 -0600
+++ b/tests/test-histedit-commute.t	Tue Mar 01 23:55:04 2016 +0100
@@ -72,6 +72,8 @@ show the edit commands offered
   #  f, fold = use commit, but combine it with the one above
   #  r, roll = like fold, but discard this commit's description
   #
+  # You can also reorder the changesets by reordering the lines
+  #
 
 edit the history
 (use a hacky editor to check histedit-last-edit.txt backup)
@@ -348,6 +350,8 @@ Verify that revsetalias entries work wit
   #  f, fold = use commit, but combine it with the one above
   #  r, roll = like fold, but discard this commit's description
   #
+  # You can also reorder the changesets by reordering the lines
+  #
 
 should also work if a commit message is missing
   $ BUNDLE="$TESTDIR/missing-comment.hg"
diff -r c7f89ad87bae -r dee0f04d72a0 tests/test-histedit-edit.t
--- a/tests/test-histedit-edit.t	Mon Feb 29 17:52:17 2016 -0600
+++ b/tests/test-histedit-edit.t	Tue Mar 01 23:55:04 2016 +0100
@@ -472,3 +472,5 @@ Attempting to fold a change into a publi
   #  f, fold = use commit, but combine it with the one above
   #  r, roll = like fold, but discard this commit's description
   #
+  # You can also reorder the changesets by reordering the lines
+  #
diff -r c7f89ad87bae -r dee0f04d72a0 tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t	Mon Feb 29 17:52:17 2016 -0600
+++ b/tests/test-histedit-obsolete.t	Tue Mar 01 23:55:04 2016 +0100
@@ -136,6 +136,8 @@ Base setup for the rest of the testing
   #  f, fold = use commit, but combine it with the one above
   #  r, roll = like fold, but discard this commit's description
   #
+  # You can also reorder the changesets by reordering the lines
+  #
   $ hg histedit 1 --commands - --verbose <<EOF | grep histedit
   > pick 177f92b77385 2 c
   > drop d2ae7f538514 1 b
diff -r c7f89ad87bae -r dee0f04d72a0 tests/test-histedit-outgoing.t
--- a/tests/test-histedit-outgoing.t	Mon Feb 29 17:52:17 2016 -0600
+++ b/tests/test-histedit-outgoing.t	Tue Mar 01 23:55:04 2016 +0100
@@ -54,6 +54,8 @@ show the edit commands offered by outgoi
   #  f, fold = use commit, but combine it with the one above
   #  r, roll = like fold, but discard this commit's description
   #
+  # You can also reorder the changesets by reordering the lines
+  #
   $ cd ..
 
 show the error from unrelated repos
@@ -86,6 +88,8 @@ show the error from unrelated repos
   #  f, fold = use commit, but combine it with the one above
   #  r, roll = like fold, but discard this commit's description
   #
+  # You can also reorder the changesets by reordering the lines
+  #
   $ cd ..
 
 test sensitivity to branch in URL:
@@ -110,6 +114,8 @@ test sensitivity to branch in URL:
   #  f, fold = use commit, but combine it with the one above
   #  r, roll = like fold, but discard this commit's description
   #
+  # You can also reorder the changesets by reordering the lines
+  #
 
 test to check number of roots in outgoing revisions
 


More information about the Mercurial-devel mailing list