sapling/tests/test-treestate-needcheck.t
Jun Wu 9719d371db treestate: add a debug command to list treestate content
Summary: This is to replace `debugstate -v`. The latter does ont list untracked files.

Reviewed By: DurhamG

Differential Revision: D12906649

fbshipit-source-id: b84f41dfadff4932c0ddd48480a4aa03db88cab0
2018-11-03 11:12:56 -07:00

42 lines
839 B
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