2019-02-12 21:52:09 +03:00
|
|
|
#require fsmonitor
|
|
|
|
|
|
|
|
$ newrepo
|
|
|
|
$ enable fsmonitor
|
2019-02-18 21:00:19 +03:00
|
|
|
$ touch a b c d e f
|
|
|
|
$ hg ci -m init -A a b c d e f
|
2019-02-12 21:52:09 +03:00
|
|
|
|
|
|
|
The fsmonitor extension should bump clock even if there are nothing changed for
|
|
|
|
treestate, but too many results returned by watchman.
|
|
|
|
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
(Run status again after 1 second to make sure mtime < fsnow)
|
|
|
|
$ sleep 1
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
In this case, treestate has 0 files marked NEED_CHECK, but fsmonitor returns
|
|
|
|
many files:
|
|
|
|
|
2019-02-18 21:00:19 +03:00
|
|
|
$ touch a b c d e f
|
2019-02-12 21:52:09 +03:00
|
|
|
|
|
|
|
$ hg debugstatus
|
2019-02-18 21:00:19 +03:00
|
|
|
len(dirstate) = 6
|
2019-02-12 21:52:09 +03:00
|
|
|
len(nonnormal) = 0
|
|
|
|
len(filtered nonnormal) = 0
|
2019-02-20 21:54:38 +03:00
|
|
|
clock = * (glob)
|
2019-02-12 21:52:09 +03:00
|
|
|
|
|
|
|
$ enable blackbox
|
|
|
|
$ setconfig blackbox.track=fsmonitor_status,fsmonitor_details,fsmonitor
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
$ hg blackbox | sed "s/^[^>]*> //;s/c:[0-9][0-9:]*/c:x/"
|
|
|
|
clock = 'c:x' len(nonnormal) = 0
|
|
|
|
setlastclock: 'c:x'
|
|
|
|
setlastisfresh: False
|
2019-02-18 21:00:19 +03:00
|
|
|
watchman returned ['a', 'b', 'c', 'd', 'e', 'f']
|
2019-02-12 21:52:09 +03:00
|
|
|
getlastclock: 'c:x'
|
|
|
|
set clock, notefiles = 'c:x', []
|
|
|
|
status exited 0 after 0.00 seconds
|
|
|
|
|
|
|
|
The watchman clock remains unchanged. Watchman still returns 4 files, which
|
|
|
|
means the "status" command could still be slow.
|
|
|
|
|
|
|
|
$ rm .hg/blackbox*
|
|
|
|
$ hg status
|
|
|
|
$ hg blackbox | grep watchman | sed "s/^[^>]*> //;s/c:[0-9][0-9:]*/c:x/"
|
2019-02-18 21:00:19 +03:00
|
|
|
watchman returned ['a', 'b', 'c', 'd', 'e', 'f']
|
2019-02-12 21:52:09 +03:00
|
|
|
|
|
|
|
With watchman-changed-file-threshold set, clock is bumped and watchman can
|
|
|
|
return an empty list:
|
|
|
|
|
2019-02-18 21:00:19 +03:00
|
|
|
$ hg status
|
|
|
|
$ setconfig fsmonitor.watchman-changed-file-threshold=5
|
2019-02-12 21:52:09 +03:00
|
|
|
|
|
|
|
$ rm .hg/blackbox*
|
|
|
|
$ hg status
|
|
|
|
$ hg blackbox | grep watchman | sed "s/^[^>]*> //;s/c:[0-9][0-9:]*/c:x/"
|
2019-02-18 21:00:19 +03:00
|
|
|
watchman returned ['a', 'b', 'c', 'd', 'e', 'f']
|
2019-02-12 21:52:09 +03:00
|
|
|
|
|
|
|
$ sleep 1
|
|
|
|
|
|
|
|
$ rm .hg/blackbox*
|
|
|
|
$ hg status
|
|
|
|
$ hg blackbox | grep watchman | sed "s/^[^>]*> //;s/c:[0-9][0-9:]*/c:x/"
|
2019-02-18 21:00:19 +03:00
|
|
|
watchman returned []
|