This adds config to disable/enable workers with default being enabled.
enabled profile without updaing .hg/hgrc (the default should be to use workers) and ran
hg sprase --enable-profile <profile>.sparse
Watched in the proces explorer that hg started 12 new threads for materializing files (this is my worker.numcpus) value
[worker] enabled = False
to the .hg/hgrc and re ran the command. This time hg didn't spawn any new threads for matreializing of files
We are in the process of registering all the config options in the file named configitems.py (https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/configitems.py#l1132), could you update the file with the new option worker.enabled. By registering the option, we will be able to centralize default values (so you can even remove the default value in the configbol call) and do nice things like validating the user configuration or easily register aliases.
I updated this line to drop the default value argument, which is not needed when the config item defines a default.
The test harness passed with the original code. The developer warning is emitted at run time. So this tells me that we have 0 test coverage of this workers code :/