tests/test-split.t
changeset 4300 702f7e1d0b01
parent 4299 4af0235e7b0b
child 4345 f45b4c31d81f
--- a/tests/test-split.t	Wed Feb 21 14:39:48 2018 +0100
+++ b/tests/test-split.t	Thu Dec 13 17:40:41 2018 +0000
@@ -897,3 +897,79 @@
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg add SPLIT3
   $ hg amend
+
+Non interractive run
+--------------------
+
+No patterns
+
+  $ hg split --no-interactive
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  adding SPLIT2
+  adding SPLIT3
+  adding SPLIT4
+  abort: no files of directories specified
+  (do you want --interactive)
+  [255]
+
+Selecting unrelated file
+(should we abort?)
+
+  $ hg split --no-interactive SPLIT1
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  adding SPLIT2
+  adding SPLIT3
+  adding SPLIT4
+  no more change to split
+  $ hg status --change '.'
+  A SPLIT2
+  A SPLIT3
+  A SPLIT4
+
+Selecting one file
+
+  $ hg split --no-interactive SPLIT2
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  adding SPLIT2
+  adding SPLIT3
+  adding SPLIT4
+  no more change to split
+  $ hg status --change '.~1'
+  A SPLIT2
+  $ hg status --change '.'
+  A SPLIT3
+  A SPLIT4
+  $ hg fold --from '.~1'
+  2 changesets folded
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Selecting two files
+
+  $ hg split --no-interactive SPLIT2 SPLIT3
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  adding SPLIT2
+  adding SPLIT3
+  adding SPLIT4
+  no more change to split
+  $ hg status --change '.~1'
+  A SPLIT2
+  A SPLIT3
+  $ hg status --change '.'
+  A SPLIT4
+  $ hg fold --from '.~1'
+  2 changesets folded
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Selecting all files
+(should we abort?)
+
+  $ hg split --no-interactive .
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  adding SPLIT2
+  adding SPLIT3
+  adding SPLIT4
+  no more change to split
+  $ hg status --change '.'
+  A SPLIT2
+  A SPLIT3
+  A SPLIT4