Patchwork D1460: workers: add config to enable/diable workers

login
register
mail settings
Submitter phabricator
Date Dec. 15, 2017, 5:13 p.m.
Message ID <c63edf80bdc9cbfd4f6ea4930c77988f@localhost.localdomain>
Download mbox | patch
Permalink /patch/26320/
State Not Applicable
Headers show

Comments

phabricator - Dec. 15, 2017, 5:13 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9b7ee7b78856: workers: add config to enable/diable workers (authored by wlis, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1460?vs=4023&id=4487

REVISION DETAIL
  https://phab.mercurial-scm.org/D1460

AFFECTED FILES
  mercurial/configitems.py
  mercurial/help/config.txt
  mercurial/worker.py

CHANGE DETAILS




To: wlis, #hg-reviewers, lothiraldan, ikostia, durin42
Cc: lothiraldan, mercurial-devel

Patch

diff --git a/mercurial/worker.py b/mercurial/worker.py
--- a/mercurial/worker.py
+++ b/mercurial/worker.py
@@ -82,7 +82,8 @@ 
     args - arguments to split into chunks, to pass to individual
     workers
     '''
-    if worthwhile(ui, costperarg, len(args)):
+    enabled = ui.configbool('worker', 'enabled', True)
+    if enabled and worthwhile(ui, costperarg, len(args)):
         return _platformworker(ui, func, staticargs, args)
     return func(*staticargs + (args,))
 
diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
--- a/mercurial/help/config.txt
+++ b/mercurial/help/config.txt
@@ -2563,6 +2563,10 @@ 
 directory updates in parallel on Unix-like systems, which greatly
 helps performance.
 
+``enabled``
+    Whether to enable workers code to be used.
+    (default: true)
+
 ``numcpus``
     Number of CPUs to use for parallel operations. A zero or
     negative value is treated as ``use the default``.
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -1253,6 +1253,9 @@ 
 coreconfigitem('worker', 'backgroundclosethreadcount',
     default=4,
 )
+coreconfigitem('worker', 'enabled',
+    default=True,
+)
 coreconfigitem('worker', 'numcpus',
     default=None,
 )