split: rework the prompt to be more standard
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 12 Dec 2018 17:22:58 +0100
changeset 4294 8974a05a49fa
parent 4293 d4902d48d095
child 4295 db87432df8de
split: rework the prompt to be more standard We dropped the initial capital and moved to a positive question.
CHANGELOG
hgext3rd/evolve/cmdrewrite.py
tests/test-evolve-obshistory-complex.t
tests/test-evolve-obshistory-lots-of-splits.t
tests/test-evolve-obshistory-split.t
tests/test-evolve-orphan-split.t
tests/test-evolve-templates.t
tests/test-prev-next.t
tests/test-rewind.t
tests/test-split.t
tests/test-topic-stack-complex.t
tests/test-topic-stack.t
--- a/CHANGELOG	Tue Feb 20 09:35:16 2018 +0100
+++ b/CHANGELOG	Wed Dec 12 17:22:58 2018 +0100
@@ -4,6 +4,8 @@
 8.4.0 - in progress
 -------------------
 
+  * split: improve and update the user prompt (BC)
+  * split: make it possible to drop change during a split
   * push: have `--publish` overrule the `auto-publish` config
   * next: evolve aspiring children by default (use --no-evolve to skip)
   * next: pick lower part of a split as destination
--- a/hgext3rd/evolve/cmdrewrite.py	Tue Feb 20 09:35:16 2018 +0100
+++ b/hgext3rd/evolve/cmdrewrite.py	Wed Dec 12 17:22:58 2018 +0100
@@ -1205,8 +1205,8 @@
             if haschanges():
                 nextaction = None
                 while nextaction is None:
-                    nextaction = ui.prompt('Done splitting? [yNdq?]', default='n')
-                    if nextaction == 'y':
+                    nextaction = ui.prompt('continue splitting? [Ycdq?]', default='y')
+                    if nextaction == 'c':
                         commands.commit(ui, repo, **opts)
                         newcommits.append(repo['.'])
                         break
@@ -1223,8 +1223,8 @@
                                        (target, node.nullid), all=True)
                     elif nextaction == '?':
                         nextaction = None
-                        ui.write(_("y - yes, commit all remaining changes\n"))
-                        ui.write(_("n - no, continue selection\n"))
+                        ui.write(_("y - yes, continue selection\n"))
+                        ui.write(_("c - commit, select all remaining changes\n"))
                         ui.write(_("d - discard, discard remaining changes\n"))
                         ui.write(_("q - quit, abort the split\n"))
                         ui.write(_("? - ?, display help\n"))
--- a/tests/test-evolve-obshistory-complex.t	Tue Feb 20 09:35:16 2018 +0100
+++ b/tests/test-evolve-obshistory-complex.t	Wed Dec 12 17:22:58 2018 +0100
@@ -144,7 +144,7 @@
   > Y
   > Y
   > N
-  > N
+  > Y
   > Y
   > Y
   > EOF
@@ -164,7 +164,7 @@
   examine changes to 'B'? [Ynesfdaq?] N
   
   created new head
-  Done splitting? [yNdq?] N
+  continue splitting? [Ycdq?] Y
   diff --git a/B b/B
   new file mode 100644
   examine changes to 'B'? [Ynesfdaq?] Y
@@ -178,7 +178,7 @@
   > Y
   > Y
   > N
-  > N
+  > Y
   > Y
   > Y
   > EOF
@@ -198,7 +198,7 @@
   examine changes to 'D'? [Ynesfdaq?] N
   
   created new head
-  Done splitting? [yNdq?] N
+  continue splitting? [Ycdq?] Y
   diff --git a/D b/D
   new file mode 100644
   examine changes to 'D'? [Ynesfdaq?] Y
@@ -213,7 +213,7 @@
   > Y
   > Y
   > N
-  > N
+  > Y
   > Y
   > Y
   > EOF
@@ -233,7 +233,7 @@
   examine changes to 'F'? [Ynesfdaq?] N
   
   created new head
-  Done splitting? [yNdq?] N
+  continue splitting? [Ycdq?] Y
   diff --git a/F b/F
   new file mode 100644
   examine changes to 'F'? [Ynesfdaq?] Y
--- a/tests/test-evolve-obshistory-lots-of-splits.t	Tue Feb 20 09:35:16 2018 +0100
+++ b/tests/test-evolve-obshistory-lots-of-splits.t	Wed Dec 12 17:22:58 2018 +0100
@@ -43,16 +43,16 @@
   > n
   > n
   > n
-  > n
+  > y
   > y
   > y
   > n
   > n
-  > n
+  > y
   > y
   > y
   > n
-  > n
+  > y
   > y
   > y
   > EOF
@@ -82,7 +82,7 @@
   examine changes to 'd'? [Ynesfdaq?] n
   
   created new head
-  Done splitting? [yNdq?] n
+  continue splitting? [Ycdq?] y
   diff --git a/b b/b
   new file mode 100644
   examine changes to 'b'? [Ynesfdaq?] y
@@ -99,7 +99,7 @@
   new file mode 100644
   examine changes to 'd'? [Ynesfdaq?] n
   
-  Done splitting? [yNdq?] n
+  continue splitting? [Ycdq?] y
   diff --git a/c b/c
   new file mode 100644
   examine changes to 'c'? [Ynesfdaq?] y
@@ -112,7 +112,7 @@
   new file mode 100644
   examine changes to 'd'? [Ynesfdaq?] n
   
-  Done splitting? [yNdq?] n
+  continue splitting? [Ycdq?] y
   diff --git a/d b/d
   new file mode 100644
   examine changes to 'd'? [Ynesfdaq?] y
--- a/tests/test-evolve-obshistory-split.t	Tue Feb 20 09:35:16 2018 +0100
+++ b/tests/test-evolve-obshistory-split.t	Wed Dec 12 17:22:58 2018 +0100
@@ -38,7 +38,7 @@
   > y
   > y
   > n
-  > n
+  > y
   > y
   > y
   > EOF
@@ -58,7 +58,7 @@
   examine changes to 'b'? [Ynesfdaq?] n
   
   created new head
-  Done splitting? [yNdq?] n
+  continue splitting? [Ycdq?] y
   diff --git a/b b/b
   new file mode 100644
   examine changes to 'b'? [Ynesfdaq?] y
--- a/tests/test-evolve-orphan-split.t	Tue Feb 20 09:35:16 2018 +0100
+++ b/tests/test-evolve-orphan-split.t	Wed Dec 12 17:22:58 2018 +0100
@@ -41,7 +41,7 @@
   > y
   > y
   > n
-  > y
+  > c
   > EOF
   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
   adding a
@@ -59,7 +59,7 @@
   examine changes to 'b'? [Ynesfdaq?] n
   
   created new head
-  Done splitting? [yNdq?] y
+  continue splitting? [Ycdq?] c
   1 new orphan changesets
 
   $ hg glog
@@ -121,7 +121,7 @@
   > y
   > y
   > y
-  > y
+  > c
   > EOF
   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
   adding a
@@ -152,7 +152,7 @@
   record change 3/3 to 'c'? [Ynesfdaq?] y
   
   created new head
-  Done splitting? [yNdq?] y
+  continue splitting? [Ycdq?] c
   1 new orphan changesets
 
   $ hg glog
--- a/tests/test-evolve-templates.t	Tue Feb 20 09:35:16 2018 +0100
+++ b/tests/test-evolve-templates.t	Wed Dec 12 17:22:58 2018 +0100
@@ -272,7 +272,7 @@
   > y
   > y
   > n
-  > n
+  > y
   > y
   > y
   > EOF
@@ -292,7 +292,7 @@
   examine changes to 'b'? [Ynesfdaq?] n
   
   created new head
-  Done splitting? [yNdq?] n
+  continue splitting? [Ycdq?] y
   diff --git a/b b/b
   new file mode 100644
   examine changes to 'b'? [Ynesfdaq?] y
--- a/tests/test-prev-next.t	Tue Feb 20 09:35:16 2018 +0100
+++ b/tests/test-prev-next.t	Wed Dec 12 17:22:58 2018 +0100
@@ -513,7 +513,7 @@
   > y
   > y
   > n
-  > N
+  > Y
   > y
   > y
   > EOF
@@ -534,7 +534,7 @@
   examine changes to 'b'? [Ynesfdaq?] n
   
   created new head
-  Done splitting? [yNdq?] N
+  continue splitting? [Ycdq?] Y
   diff --git a/b b/b
   new file mode 100644
   examine changes to 'b'? [Ynesfdaq?] y
--- a/tests/test-rewind.t	Tue Feb 20 09:35:16 2018 +0100
+++ b/tests/test-rewind.t	Wed Dec 12 17:22:58 2018 +0100
@@ -460,7 +460,7 @@
   > y
   > f
   > d
-  > y
+  > c
   > EOF
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   adding C
@@ -478,7 +478,7 @@
   examine changes to 'D'? [Ynesfdaq?] d
   
   created new head
-  Done splitting? [yNdq?] y
+  continue splitting? [Ycdq?] c
   $ hg log -G
   @  changeset:   5:9576e80d6851
   |  tag:         tip
--- a/tests/test-split.t	Tue Feb 20 09:35:16 2018 +0100
+++ b/tests/test-split.t	Wed Dec 12 17:22:58 2018 +0100
@@ -55,7 +55,7 @@
   > y
   > y
   > n
-  > N
+  > Y
   > y
   > y
   > EOF
@@ -79,7 +79,7 @@
   record change 2/2 to '_d'? [Ynesfdaq?] n
   
   created new head
-  Done splitting? [yNdq?] N
+  continue splitting? [Ycdq?] Y
   diff --git a/_d b/_d
   new file mode 100644
   examine changes to '_d'? [Ynesfdaq?] y
@@ -179,7 +179,7 @@
   > y
   > y
   > n
-  > y
+  > c
   > EOF
   2 files updated, 0 files merged, 2 files removed, 0 files unresolved
   reverting _b
@@ -201,7 +201,7 @@
   record change 2/2 to '_c'? [Ynesfdaq?] n
   
   created new head
-  Done splitting? [yNdq?] y
+  continue splitting? [Ycdq?] c
   2 new orphan changesets
 
 Stop before splitting the commit completely creates a commit with all the
@@ -281,7 +281,7 @@
   > y
   > y
   > n
-  > y
+  > c
   > EOF
   (leaving bookmark bookB)
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -302,7 +302,7 @@
   examine changes to '_d'? [Ynesfdaq?] n
   
   created new head
-  Done splitting? [yNdq?] y
+  continue splitting? [Ycdq?] c
   $ hg log -G -r "3f134f739075::"
   @  changeset:   16:452a26648478
   |  bookmark:    bookA
@@ -435,7 +435,7 @@
   > Y
   > Y
   > N
-  > Y
+  > c
   > Y
   > Y
   > EOF
@@ -454,16 +454,7 @@
   new file mode 100644
   examine changes to 'celeste'? [Ynesfdaq?] N
   
-  Done splitting? [yNdq?] Y
-  diff --git a/celeste b/celeste
-  new file mode 100644
-  examine changes to 'celeste'? [Ynesfdaq?] Y
-  
-  @@ -0,0 +1,1 @@
-  +celeste
-  record this change to 'celeste'? [Ynesfdaq?] Y
-  
-  no more change to split
+  continue splitting? [Ycdq?] c
 
 Check that the topic is still here
 
@@ -537,7 +528,7 @@
   $ hg split -r . << EOF
   > Y
   > N
-  > N
+  > Y
   > Y
   > EOF
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
@@ -551,7 +542,7 @@
   new file mode 100644
   examine changes to 'SPLIT2'? [Ynesfdaq?] N
   
-  Done splitting? [yNdq?] N
+  continue splitting? [Ycdq?] Y
   diff --git a/SPLIT2 b/SPLIT2
   new file mode 100644
   examine changes to 'SPLIT2'? [Ynesfdaq?] Y
@@ -687,13 +678,13 @@
   ? - ? (display help)
   examine changes to 'SPLIT4'? [Ynesfdaq?] d
   
-  Done splitting? [yNdq?] ?
-  y - yes, commit all remaining changes
-  n - no, continue selection
+  continue splitting? [Ycdq?] ?
+  y - yes, continue selection
+  c - commit, select all remaining changes
   d - discard, discard remaining changes
   q - quit, abort the split
   ? - ?, display help
-  Done splitting? [yNdq?] q
+  continue splitting? [Ycdq?] q
   transaction abort!
   rollback completed
   abort: user quit
@@ -754,7 +745,7 @@
   new file mode 100644
   examine changes to 'SPLIT3'? [Ynesfdaq?] d
   
-  Done splitting? [yNdq?] d
+  continue splitting? [Ycdq?] d
   discarding remaining changes
   forgetting SPLIT3
   $ hg export
--- a/tests/test-topic-stack-complex.t	Tue Feb 20 09:35:16 2018 +0100
+++ b/tests/test-topic-stack-complex.t	Wed Dec 12 17:22:58 2018 +0100
@@ -63,7 +63,7 @@
   > y
   > y
   > n
-  > y
+  > c
   > EOF
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   adding c
@@ -80,7 +80,7 @@
   new file mode 100644
   examine changes to 'd'? [Ynesfdaq?] n
   
-  Done splitting? [yNdq?] y
+  continue splitting? [Ycdq?] c
   1 new orphan changesets
 
   $ hg stack
--- a/tests/test-topic-stack.t	Tue Feb 20 09:35:16 2018 +0100
+++ b/tests/test-topic-stack.t	Wed Dec 12 17:22:58 2018 +0100
@@ -894,7 +894,7 @@
   > y
   > y
   > n
-  > y
+  > c
   > EOF
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   adding Z
@@ -911,7 +911,7 @@
   new file mode 100644
   examine changes to 'ggg'? [Ynesfdaq?] n
   
-  Done splitting? [yNdq?] y
+  continue splitting? [Ycdq?] c
 
   $ hg --config extensions.evolve= obslog --all
   o  dde94df880e9 (21) c_G