Mercurial > hg
comparison tests/test-hgignore.t @ 47409:0ef8231e413f
dirstate-v2: Store a hash of ignore patterns (.hgignore)
Later, this help extend `read_dir` caching to directories that contain ignored
files (but no unknown files). Such cache must be invalidated when ignore patterns
change since a formerly-ignored file might become unknown.
This helps the default configuration of `hg status` where unknown files must
be listed, but ignored files are not.
Differential Revision: https://phab.mercurial-scm.org/D10836
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Wed, 02 Jun 2021 11:25:18 +0200 |
parents | 6763913fa175 |
children | f23eafb036af |
comparison
equal
deleted
inserted
replaced
47408:7954ee2d7cf7 | 47409:0ef8231e413f |
---|---|
400 dir1/file2 is ignored | 400 dir1/file2 is ignored |
401 (ignore rule in $TESTTMP\ignorerepo\.hgignore, line 4: 'dir1/file*') | 401 (ignore rule in $TESTTMP\ignorerepo\.hgignore, line 4: 'dir1/file*') |
402 $ hg up -qC . | 402 $ hg up -qC . |
403 | 403 |
404 #endif | 404 #endif |
405 | |
406 #if dirstate-v2 | |
407 | |
408 Check the hash of ignore patterns written in the dirstate at offset | |
409 12 + 20 + 20 + 8 + 4 + 4 + 4 = 72 | |
410 | |
411 $ hg status > /dev/null | |
412 $ cat .hg/testhgignore .hg/testhgignorerel .hgignore dir2/.hgignore dir1/.hgignore dir1/.hgignoretwo | $TESTDIR/f --sha1 | |
413 sha1=6e315b60f15fb5dfa02be00f3e2c8f923051f5ff | |
414 >>> import binascii; print(binascii.hexlify(open(".hg/dirstate", "rb").read()[72:][:20]).decode()) | |
415 6e315b60f15fb5dfa02be00f3e2c8f923051f5ff | |
416 | |
417 $ echo rel > .hg/testhgignorerel | |
418 $ hg status > /dev/null | |
419 $ cat .hg/testhgignore .hg/testhgignorerel .hgignore dir2/.hgignore dir1/.hgignore dir1/.hgignoretwo | $TESTDIR/f --sha1 | |
420 sha1=dea19cc7119213f24b6b582a4bae7b0cb063e34e | |
421 >>> import binascii; print(binascii.hexlify(open(".hg/dirstate", "rb").read()[72:][:20]).decode()) | |
422 dea19cc7119213f24b6b582a4bae7b0cb063e34e | |
423 | |
424 #endif |