diff tests/test-histedit-arguments.t @ 37106:3d3cff1f6bde

histedit: make histedit's commands accept revsets (issue5746) Earlier the code was only looking for rulehashes and neglecting all other revision identifiers, this code intercepts the fromrule function and calls scmutil.revsingle() on anything that is not a rulehash and then obtains the rulehash from the changectx object returned, rest of the pipeline follows as it was Differential Revision: https://phab.mercurial-scm.org/D2394
author Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
date Fri, 23 Feb 2018 11:48:58 +0530
parents 21f4697ef789
children 5abc47d4ca6b
line wrap: on
line diff
--- a/tests/test-histedit-arguments.t	Sat Mar 17 17:54:33 2018 +0900
+++ b/tests/test-histedit-arguments.t	Fri Feb 23 11:48:58 2018 +0530
@@ -236,10 +236,10 @@
 
   $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
   > pick eb57da33312f 2 three
-  > pick 0
+  > pick 0u98
   > pick 08d98a8350f3 4 five
   > EOF
-  hg: parse error: invalid changeset 0
+  hg: parse error: invalid changeset 0u98
   [255]
 
 Test short version of command
@@ -552,3 +552,39 @@
   #
 
   $ cd ..
+
+Check that histedit's commands accept revsets
+  $ hg init bar
+  $ cd bar
+  $ echo w >> a
+  $ hg ci -qAm "adds a"
+  $ echo x >> b
+  $ hg ci -qAm "adds b"
+  $ echo y >> c
+  $ hg ci -qAm "adds c"
+  $ echo z >> d
+  $ hg ci -qAm "adds d"
+  $ hg log -G -T '{rev} {desc}\n'
+  @  3 adds d
+  |
+  o  2 adds c
+  |
+  o  1 adds b
+  |
+  o  0 adds a
+  
+  $ HGEDITOR=cat hg histedit "2" --commands - << EOF
+  > base -4 adds c
+  > pick 2 adds c
+  > pick tip adds d
+  > EOF
+  $ hg log -G -T '{rev} {desc}\n'
+  @  5 adds d
+  |
+  o  4 adds c
+  |
+  | o  1 adds b
+  |/
+  o  0 adds a
+  
+