changeset 36231:a228b2f55ad6

tests: add a test demonstrate that 'revert -i' ignores nonexistent patterns As described in issue5789, when revert is called through: hg revert -i <some file that does not exist> we'd expect the command to abort early. Currently, it just warns about missing file but prompt about files unrelated to user arguments.
author Denis Laxalde <denis@laxalde.org>
date Sun, 11 Feb 2018 20:37:44 +0100
parents eb91ffdaaece
children 39b3aab6231e
files tests/test-revert-interactive.t
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-revert-interactive.t	Wed Feb 14 17:44:54 2018 +0530
+++ b/tests/test-revert-interactive.t	Sun Feb 11 20:37:44 2018 +0100
@@ -420,4 +420,17 @@
   $ cat a
   0
 
+When specified pattern does not exist, we should exit early (issue5789).
+
+  $ hg files
+  a
+  $ hg rev b
+  b: no such file in rev b40d1912accf
+  $ hg rev -i b
+  b: no such file in rev b40d1912accf
+  diff --git a/a b/a
+  1 hunks, 1 lines changed
+  examine changes to 'a'? [Ynesfdaq?] abort: response expected
+  [255]
+
   $ cd ..