mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 17:27:53 +03:00
Summary: Add a test about NEED_CHECK cleanup for files outside sparse. It does not demostrate anything wrong, unfortunately. Reviewed By: DurhamG Differential Revision: D12906651 fbshipit-source-id: 6e9e690ba431e141666ffdb431f62280e86bbf0b
74 lines
1.5 KiB
Perl
74 lines
1.5 KiB
Perl
Emulate situations where NEED_CHECK was added to normal files and there should
|
|
be a way to remove them.
|
|
|
|
$ newrepo
|
|
$ drawdag << 'EOS'
|
|
> B
|
|
> |
|
|
> A
|
|
> EOS
|
|
$ hg up $B -q
|
|
|
|
Write mtime to treestate
|
|
|
|
$ sleep 1
|
|
|
|
$ hg status
|
|
|
|
$ hg debugtree list
|
|
A: 0100644 1 + EXIST_P1 EXIST_NEXT
|
|
B: 0100644 1 + EXIST_P1 EXIST_NEXT
|
|
|
|
Force the files to have NEED_CHECK bits
|
|
|
|
$ hg debugshell -c "
|
|
> with repo.lock(), repo.transaction('needcheck') as tr:
|
|
> d = repo.dirstate
|
|
> d.needcheck('A')
|
|
> d.needcheck('B')
|
|
> d.write(tr)
|
|
> "
|
|
$ hg debugtree list
|
|
A: 0100644 1 + EXIST_P1 EXIST_NEXT NEED_CHECK
|
|
B: 0100644 1 + EXIST_P1 EXIST_NEXT NEED_CHECK
|
|
|
|
Run status again. NEED_CHECK will disappear.
|
|
|
|
$ hg status
|
|
|
|
$ hg debugtree list
|
|
A: 0100644 1 + EXIST_P1 EXIST_NEXT
|
|
B: 0100644 1 + EXIST_P1 EXIST_NEXT
|
|
|
|
Enable sparse
|
|
|
|
$ enable sparse
|
|
$ hg sparse include A
|
|
|
|
When removing "B", fsmonitor+treestate will mark it as "NEED_CHECK" instead
|
|
|
|
$ hg debugtree list
|
|
A: 0100644 1 + EXIST_P1 EXIST_NEXT
|
|
B: 0100644 1 + NEED_CHECK (fsmonitor !)
|
|
|
|
Force NEED_CHECK on files outside sparse
|
|
|
|
$ printf B > B
|
|
$ hg debugshell --config extensions.sparse=! -c "
|
|
> with repo.lock(), repo.transaction('needcheck') as tr:
|
|
> d = repo.dirstate
|
|
> d.needcheck('A')
|
|
> d.normal('B')
|
|
> d.needcheck('B')
|
|
> d.write(tr)
|
|
> "
|
|
|
|
Run "hg status" and NEED_CHECK can be removed:
|
|
|
|
$ sleep 1
|
|
$ hg status
|
|
|
|
$ hg debugtree list
|
|
A: 0100644 1 + EXIST_P1 EXIST_NEXT
|
|
B: 0100644 1 + EXIST_P1 EXIST_NEXT
|