summaryrefslogtreecommitdiffstats
path: root/subcmds/status.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2021-02-16 01:43:31 -0500
committerMike Frysinger <vapier@google.com>2021-02-22 22:51:07 +0000
commit6a2400a4d097b6e510dc9b8ec06283517b9ca3ad (patch)
tree55ad212633615a1d0ea1bb3f5c294f495bd223a7 /subcmds/status.py
parentc5bbea8db364b88558acc434be16ec82c04737e5 (diff)
downloadgit-repo-6a2400a4d097b6e510dc9b8ec06283517b9ca3ad.tar.gz
command: unify --job option & default values
Extend the Command class to support adding the --jobs option to the parser if the command declares it supports running in parallel. Also pull the default value used for the number of local jobs into the command module so local commands can share it. Change-Id: I22b0f8d2cf69875013cec657b8e6c4385549ccac Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/297024 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Chris Mcdonald <cjmcdonald@google.com>
Diffstat (limited to 'subcmds/status.py')
-rw-r--r--subcmds/status.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/subcmds/status.py b/subcmds/status.py
index e293d75c..f0f2e034 100644
--- a/subcmds/status.py
+++ b/subcmds/status.py
@@ -17,7 +17,7 @@ import glob
17import multiprocessing 17import multiprocessing
18import os 18import os
19 19
20from command import PagedCommand 20from command import DEFAULT_LOCAL_JOBS, PagedCommand
21 21
22from color import Coloring 22from color import Coloring
23import platform_utils 23import platform_utils
@@ -76,11 +76,10 @@ the following meanings:
76 d: deleted ( in index, not in work tree ) 76 d: deleted ( in index, not in work tree )
77 77
78""" 78"""
79 PARALLEL_JOBS = DEFAULT_LOCAL_JOBS
79 80
80 def _Options(self, p): 81 def _Options(self, p):
81 p.add_option('-j', '--jobs', 82 super()._Options(p)
82 dest='jobs', action='store', type='int', default=2,
83 help="number of projects to check simultaneously")
84 p.add_option('-o', '--orphans', 83 p.add_option('-o', '--orphans',
85 dest='orphans', action='store_true', 84 dest='orphans', action='store_true',
86 help="include objects in working directory outside of repo projects") 85 help="include objects in working directory outside of repo projects")