Patchwork D10699: dirstate-tree: Add a test showing that issue 6335 is fixed

login
register
mail settings
Submitter phabricator
Date May 7, 2021, 4:45 p.m.
Message ID <differential-rev-PHID-DREV-m3vz2gttfuk42dpmp7op-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49017/
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
  … when using the new status algorithm and the tree-based dirstate.
  The previous algorithm still has this bug.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -699,3 +699,38 @@ 
   $ hg add a.py b.rs
   $ hg st -aI "*.py"
   A a.py
+
+issue6335
+When a directory containing a tracked file gets symlinked, as of 5.8
+`hg st` only gives the correct answer about clean (or deleted) files 
+if also listing unknowns.
+The tree-based dirstate and status algorithm fix this:
+
+#if symlink no-dirstate-v1
+
+  $ cd ..
+  $ hg init issue6335
+  $ cd issue6335
+  $ mkdir foo
+  $ touch foo/a
+  $ hg ci -Ama
+  adding foo/a
+  $ mv foo bar
+  $ ln -s bar foo
+  $ hg status
+  ! foo/a
+  ? bar/a
+  ? foo
+
+  $ hg status -c  # incorrect output with `dirstate-v1`
+  $ hg status -cu
+  ? bar/a
+  ? foo
+  $ hg status -d  # incorrect output with `dirstate-v1`
+  ! foo/a
+  $ hg status -du
+  ! foo/a
+  ? bar/a
+  ? foo
+
+#endif