diff tests/test-prev-next.t @ 3549:802441114400

next: prompt user to choose child in ambiguity in `hg next --evolve` This patch makes `hg next --evolve` prompt user to choose a child to evolve and update when multiple of them exists. This is improvement over previous behavior where we used to error out saying ambiguous next unstable changeset and told user to manually use `hg evolve -r rev`. While writing this patch, I am personally very happy to have this feature as I have encountered this stage many times and I wanted `next --evolve` to take care of that. It uses the revselectionprompt thing added in earlier patches.
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 16 Mar 2018 12:14:39 +0530
parents 78abffad8626
children ce346c6165c6
line wrap: on
line diff
--- a/tests/test-prev-next.t	Fri Mar 16 11:56:50 2018 +0530
+++ b/tests/test-prev-next.t	Fri Mar 16 12:14:39 2018 +0530
@@ -235,12 +235,30 @@
   no children
   (2 unstable changesets to be evolved here, do you want --evolve?)
   [1]
-  $ hg next --evolve
-  ambiguous next (unstable) changeset:
-  [4] added c
-  [5] added d
-  (run 'hg evolve --rev REV' on one of them)
-  [1]
+  $ hg next --evolve <<EOF
+  > 0
+  > EOF
+  ambiguous next (unstable) changeset, choose one to evolve and update:
+  0: [e3b6d5df389b] added c
+  1: [9df671ccd2c7] added d
+  q: quit the prompt
+  enter the index of the revision you want to select: 0
+  move:[4] added c
+  atop:[6] added b (3)
+  working directory now at 5ce67c2407b0
+
+  $ hg log -GT "{rev}:{node|short} {desc}\n"
+  @  7:5ce67c2407b0 added c
+  |
+  o  6:d7f119adc759 added b (3)
+  |
+  | *  5:9df671ccd2c7 added d
+  | |
+  | x  3:9ad178109a19 added b (2)
+  |/
+  o  0:a154386e50d1 added a
+  
+
   $ hg evolve -r 5
   move:[5] added d
   atop:[6] added b (3)