concurrency: add a global 'jobs' config item
2 files changed, 9 insertions(+), 7 deletions(-)

M hgext3rd/confman/__init__.py
M hgext3rd/confman/commands.py
M hgext3rd/confman/__init__.py +3 -5
@@ 15,11 15,9 @@ from .meta import colortable
 configtable = {}
 configitem = registrar.configitem(configtable)
 
-configitem(
-    b'confman',
-    b'hggit',
-    default=True,
-)
+configitem(b'confman', b'hggit', default=True)
+
+configitem(b'confman', b'jobs', default=1)
 
 
 def extsetup(ui):

          
M hgext3rd/confman/commands.py +6 -2
@@ 60,7 60,7 @@ def command(name, opts):
             "do not update managed if it is on a descendant of track",
         ),
         ("", "ci", False, "enable ci mode"),
-        ("j", "jobs", 1, "number of operations to run in parallel"),
+        ("j", "jobs", 0, "number of operations to run in parallel"),
     ],
 )
 def ensureconf(ui, repo, *args, **opts):

          
@@ 103,7 103,11 @@ def ensureconf(ui, repo, *args, **opts):
         def checkout_repo(section, rev, conf):
             confman.checkout_section(section, snaps, opts.get("keep_descendant", False))
 
-    with runner.Runner(opts.get('jobs', 1)) as r:
+    jobs = opts.get('jobs')
+    if jobs == 0:
+        jobs = ui.configint(b'confman', b'jobs')
+
+    with runner.Runner(jobs) as r:
 
         def checkout(need_checkout):
             nonlocal ready