fsmonitor: use vfs instead of opener (
issue5938)
"opener" of localrepository object was dropped at Mercurial 4.3 (or
a7e210167c28). "vfs" should be used instead.
wlock is required to write into a file under .hg directory.
For efficiency, we should change _cmpsets() from:
1. acquire wlock
2. open log file under .hg directory with write mode
3. compare between result of watchman and Mercurial's dirstate logic
4. write out error info into a file, if error is detected
5. release wlock
to:
1. compare between result of watchman and Mercurial's dirstate logic
2. acquire wlock, if error is detected
3. open and write error info into a file
4. release wlock
But this is another issue.
tests: configure fsmonitor.mode=paranoid always if fsmonitor is used
This forces fsmonitor extension execute "paranoid" code path.
Strict speaking, we should make fsmonitor-run-tests.py accept own
specific options, but there is no code path, which is disabled in
"paranoid" mode, at least now. Therefore, this solution seems
reasonable enough.
tests: drop files from exclusion list in test-check-module-imports.t
Now, these files has no style issue at checking with import-checker.py.
BTW, tests/test-imports-checker.t is still excluded, because almost
all code fragments in it has intentional importing style violation.
Using NO_CHECK_EOF instead of EOF as heredoc limit mark can make
import-checker.py ignore such fragments. But keeping these fragments
checkable seems still useful: for example, test-imports-checker.t can
be used to test whether import-checker.py can detect erroneous code
fragment in test script as expected.
tests: use NO_CHECK_EOF for fragments used to test importing via extension
test-extension.t is excluded in test-check-module-imports.t, because
import-checker.py reports that some python code fragments in it does
not import modules in recommended style.
These code fragments are used to test importing modules relatively and
absolutely via extension (e.g.
issue4029,
issue5208, and so on). Test
specific package hierarchy becomes complicated for this purpose, and
it seems reasonable to avoid checking these code fragments with
import-checker.py.
But on the other hand, other code fragments in test-extension.t should
be checked by import-checker.py.
Therefore, this patch uses NO_CHECK_EOF limit mark only for python
code fragments, which are used to test importing via extension in
test-extension.t. NO_CHECK_EOF limit mark tells import-checker.py that
this code fragment should be ignored, via testparseutil.py.
tests: use NO_CHECK_EOF for fragments having intentional error
Some test scripts are excluded in test-check-module-imports.t, because
import-checker.py reports that code fragments embedded in these test
scripts have syntax error. But these syntax error is intentional.
This patch uses NO_CHECK_EOF instead of EOF as heredoc limit mark for
such fragments, in order to make import-checker.py ignore
them. NO_CHECK_EOF limit mark tells import-checker.py that this code
fragment should be ignored, via testparseutil.py.
tests: fix style issue of importing order in test-lock.py
test-lock.py is excluded in test-check-module-imports.t, because
import-checker.py reports that some stdlibs are imported after local
silenttestrunner module.
I can not found out any reason why tests/silenttestrunner.py should be
imported before some stdlibs from the point of functionality view.