mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
92f6f35e7a
Summary: This diff marks **ALL** mercurial tests requiring Python 2 feature. After you fixes some tests, simply remove the `py2` feature requirement and that tests will be continuously run after your diff is landed. To bypass this feature requirement, run the tests command with `HGTEST_FORCE_PY2=1`. For example: ``` HGTEST_FORCE_PY2=1 buck test //eden/scm/tests:hg_run_tests ``` or ``` HGTEST_FORCE_PY2=1 python run-tests.py ``` ---- Basically this diff are created with the following commands: ``` $ sed -i 's/import feature\(.*\)$/import feature\1\n\nfeature.require(["py2"])/' test-*-t.py $ sed -i '1s/^/#require py2\n/' test-*.t $ ls | grep -P "^test.*(?<\!-t)\.py$" > list && vim -p $(cat list) # manually adding feature requires for these Python tests. ``` (Note: this ignores all push blocking failures!) ignore-conflict-markers Reviewed By: singhsrb Differential Revision: D19655148 fbshipit-source-id: 985e3ccb4010cc559049f1d89f8909bc2d9b5e20
60 lines
1.7 KiB
Perl
60 lines
1.7 KiB
Perl
#require py2
|
|
#require fsmonitor
|
|
|
|
$ newrepo
|
|
$ enable fsmonitor
|
|
$ touch a b c d e f
|
|
$ hg ci -m init -A a b c d e f
|
|
|
|
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:
|
|
|
|
$ touch a b c d e f
|
|
|
|
$ hg debugstatus
|
|
len(dirstate) = 6
|
|
len(nonnormal) = 0
|
|
len(filtered nonnormal) = 0
|
|
clock = * (glob)
|
|
|
|
$ rm -rf .hg/blackbox*
|
|
$ hg status
|
|
|
|
$ hg blackbox --no-timestamp --no-sid --pattern '{"fsmonitor":"_"}'
|
|
[fsmonitor] clock: "c:*" -> "c:*"; need check: * + ["a", "b", "c", "d", "e"] and 1 entries (glob)
|
|
|
|
The watchman clock remains unchanged. Watchman still returns 6 files, which
|
|
means the "status" command could still be slow.
|
|
|
|
$ rm -rf .hg/blackbox*
|
|
$ hg status
|
|
$ hg blackbox --no-timestamp --no-sid --pattern '{"fsmonitor":"_"}'
|
|
[fsmonitor] clock: "c:*" -> "c:*"; need check: * + ["a", "b", "c", "d", "e"] and 1 entries (glob)
|
|
|
|
With watchman-changed-file-threshold set, clock is bumped and watchman can
|
|
return an empty list:
|
|
|
|
$ hg status
|
|
$ setconfig fsmonitor.watchman-changed-file-threshold=5
|
|
|
|
$ rm -rf .hg/blackbox*
|
|
$ hg status
|
|
$ hg blackbox --no-timestamp --no-sid --pattern '{"fsmonitor":"_"}'
|
|
[fsmonitor] clock: "c:*" -> "c:*"; need check: * + ["a", "b", "c", "d", "e"] and 1 entries (glob)
|
|
|
|
$ sleep 1
|
|
|
|
$ rm -rf .hg/blackbox*
|
|
$ hg status
|
|
$ hg blackbox --no-timestamp --no-sid --pattern '{"fsmonitor":"_"}'
|
|
[fsmonitor] clock: "c:*" -> "c:*"; need check: [] + [] (glob)
|