# HG changeset patch # User Raphaël Gomès # Date 1667399079 -3600 # Node ID ca19335e86e586d4efa801317af5b8b48b9796e8 # Parent 9172bd49cedca183b840c961d9f8787e02146645 dirstate-v2: add test that shows a collision in ignore patterns hash This hash is used for optimizing dirstate `status`. We demonstrate that the hash is incorrectly ignoring the changes to the semantics of the ignore files just because the contents (but not their source) haven't changed. This is fixed in the next changeset. diff -r 9172bd49cedc -r ca19335e86e5 tests/test-hgignore.t --- a/tests/test-hgignore.t Thu Nov 03 12:08:02 2022 +0100 +++ b/tests/test-hgignore.t Wed Nov 02 15:24:39 2022 +0100 @@ -433,5 +433,33 @@ sha1=dea19cc7119213f24b6b582a4bae7b0cb063e34e $ hg debugstate --docket | grep ignore ignore pattern hash: dea19cc7119213f24b6b582a4bae7b0cb063e34e + $ cd .. + +Check that the hash depends on the source of the hgignore patterns +(otherwise the context is lost and things like subinclude are cached improperly) + + $ hg init ignore-collision + $ cd ignore-collision + $ echo > .hg/testhgignorerel + + $ mkdir dir1/ dir1/subdir + $ touch dir1/subdir/f dir1/subdir/ignored1 + $ echo 'ignored1' > dir1/.hgignore + + $ mkdir dir2 dir2/subdir + $ touch dir2/subdir/f dir2/subdir/ignored2 + $ echo 'ignored2' > dir2/.hgignore + $ echo 'subinclude:dir2/.hgignore' >> .hgignore + $ echo 'subinclude:dir1/.hgignore' >> .hgignore + + $ hg commit -Aqm_ + + $ > dir1/.hgignore + $ echo 'ignored' > dir2/.hgignore + $ echo 'ignored1' >> dir2/.hgignore + $ hg status + M dir1/.hgignore + M dir2/.hgignore + ? dir1/subdir/ignored1 (missing-correct-output !) #endif