mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
f526d1a4ed
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
23 lines
647 B
Raku
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
|