sapling/tests/test-treestate-fresh-instance.t
Jun Wu f526d1a4ed treestate: update clock when watchman returns is_fresh_instance=True
Summary:
When watchman returns is_fresh_instance=True, it means the old clock value
cannot help watchman to do less work. Therefore the clock value needs to be
updated to make the next status call faster.

Reviewed By: phillco

Differential Revision: D8714863

fbshipit-source-id: 1eb2bf876b21bd0f17134a3b93b06b759746fd4c
2018-07-02 13:35:42 -07:00

23 lines
647 B
Raku

#require fsmonitor
$ setconfig format.dirstate=2
$ newrepo
$ touch x
$ hg status
? x
$ hg debugshell --command 'print(repo.dirstate.getclock())'
c:* (glob)
Change the clock to an invalid value
$ hg debugshell --command 'with repo.wlock(), repo.lock(), repo.transaction("dirstate") as tr: repo.dirstate.setclock("c:11111:22222"); repo.dirstate.write(tr)'
$ hg debugshell --command 'print(repo.dirstate.getclock())'
c:11111:22222
Run "hg status" again. A new clock value will be written even if no files are changed
$ hg status
? x
$ hg debugshell --command 'print(repo.dirstate.getclock() != "c:11111:22222")'
True