status: Add tests for some more edge cases
authorSimon Sapin <simon.sapin@octobus.net>
Fri, 07 May 2021 17:33:47 +0200
changeset 47132 65e6970042c5
parent 47131 46c6be5f1efa
child 47133 5e5fad5166e6
status: Add tests for some more edge cases * Size-preserving file contents modification * Filtering output to a deleted or removed file Differential Revision: https://phab.mercurial-scm.org/D10701
tests/test-status.t
--- a/tests/test-status.t	Fri May 07 16:44:36 2021 +0200
+++ b/tests/test-status.t	Fri May 07 17:33:47 2021 +0200
@@ -689,6 +689,29 @@
   $ ln -s ../repo0/.hg
   $ hg status
 
+If the size hasn’t changed but mtime has, status needs to read the contents
+of the file to check whether it has changed
+
+  $ echo 1 > a
+  $ echo 1 > b
+  $ touch -t 200102030000 a b
+  $ hg commit -Aqm '#0'
+  $ echo 2 > a
+  $ touch -t 200102040000 a b
+  $ hg status
+  M a
+
+Asking specifically for the status of a deleted/removed file
+
+  $ rm a
+  $ rm b
+  $ hg status a
+  ! a
+  $ hg rm a
+  $ hg rm b
+  $ hg status a
+  R a
+
 Check using include flag with pattern when status does not need to traverse
 the working directory (issue6483)