Patchwork [16,of,18] configitems: register the 'worker.backgroundcloseminfilecount' config

login
register
mail settings
Submitter Pierre-Yves David
Date July 2, 2017, 10:25 p.m.
Message ID <65909c3e69051008c933.1499034333@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21939/
State Accepted
Headers show

Comments

Pierre-Yves David - July 2, 2017, 10:25 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1498787159 -7200
#      Fri Jun 30 03:45:59 2017 +0200
# Node ID 65909c3e69051008c933e548c6e12a760517559e
# Parent  738344bfccade4f9b339ed54fc599523ef66dc71
# EXP-Topic config.register.worker
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 65909c3e6905
configitems: register the 'worker.backgroundcloseminfilecount' config

Patch

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -119,3 +119,6 @@  coreconfigitem('ui', 'quiet',
 coreconfigitem('worker', 'backgroundclosemaxqueue',
     default=384,
 )
+coreconfigitem('worker', 'backgroundcloseminfilecount',
+    default=2048,
+)
diff --git a/mercurial/vfs.py b/mercurial/vfs.py
--- a/mercurial/vfs.py
+++ b/mercurial/vfs.py
@@ -541,8 +541,7 @@  class backgroundfilecloser(object):
         # There is overhead to starting and stopping the background threads.
         # Don't do background processing unless the file count is large enough
         # to justify it.
-        minfilecount = ui.configint('worker', 'backgroundcloseminfilecount',
-                                    2048)
+        minfilecount = ui.configint('worker', 'backgroundcloseminfilecount')
         # FUTURE dynamically start background threads after minfilecount closes.
         # (We don't currently have any callers that don't know their file count)
         if expectedcount > 0 and expectedcount < minfilecount: