Patchwork D10701: status: Add tests for some more edge cases

login
register
mail settings
Submitter phabricator
Date May 7, 2021, 4:45 p.m.
Message ID <differential-rev-PHID-DREV-qvtjjah5fxz65ht5e64i-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49019/
State Superseded
Headers show

Comments

phabricator - May 7, 2021, 4:45 p.m.
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  - Size-preserving file contents modification
  - Filtering output to a deleted or removed file

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10701

AFFECTED FILES
  tests/test-status.t

CHANGE DETAILS




To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-status.t b/tests/test-status.t
--- a/tests/test-status.t
+++ b/tests/test-status.t
@@ -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 -d 2001-02-03 a b
+  $ hg commit -Aqm '#0'
+  $ echo 2 > a
+  $ touch -d 2001-02-04 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)