diff options
Diffstat (limited to 'subcmds/branches.py')
| -rw-r--r-- | subcmds/branches.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/subcmds/branches.py b/subcmds/branches.py index 20f51693..9665e85f 100644 --- a/subcmds/branches.py +++ b/subcmds/branches.py | |||
| @@ -16,7 +16,7 @@ import itertools | |||
| 16 | import multiprocessing | 16 | import multiprocessing |
| 17 | import sys | 17 | import sys |
| 18 | from color import Coloring | 18 | from color import Coloring |
| 19 | from command import Command | 19 | from command import Command, DEFAULT_LOCAL_JOBS |
| 20 | 20 | ||
| 21 | # Number of projects to submit to a single worker process at a time. | 21 | # Number of projects to submit to a single worker process at a time. |
| 22 | # This number represents a tradeoff between the overhead of IPC and finer | 22 | # This number represents a tradeoff between the overhead of IPC and finer |
| @@ -103,17 +103,7 @@ the branch appears in, or does not appear in. If no project list | |||
| 103 | is shown, then the branch appears in all projects. | 103 | is shown, then the branch appears in all projects. |
| 104 | 104 | ||
| 105 | """ | 105 | """ |
| 106 | 106 | PARALLEL_JOBS = DEFAULT_LOCAL_JOBS | |
| 107 | def _Options(self, p): | ||
| 108 | """Add flags to CLI parser for this subcommand.""" | ||
| 109 | default_jobs = min(multiprocessing.cpu_count(), 8) | ||
| 110 | p.add_option( | ||
| 111 | '-j', | ||
| 112 | '--jobs', | ||
| 113 | type=int, | ||
| 114 | default=default_jobs, | ||
| 115 | help='Number of worker processes to spawn ' | ||
| 116 | '(default: %s)' % default_jobs) | ||
| 117 | 107 | ||
| 118 | def Execute(self, opt, args): | 108 | def Execute(self, opt, args): |
| 119 | projects = self.GetProjects(args) | 109 | projects = self.GetProjects(args) |
