diff options
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/forall.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/subcmds/forall.py b/subcmds/forall.py index c9de26bc..96eac541 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py | |||
@@ -139,6 +139,9 @@ without iterating through the remaining projects. | |||
139 | p.add_option('-e', '--abort-on-errors', | 139 | p.add_option('-e', '--abort-on-errors', |
140 | dest='abort_on_errors', action='store_true', | 140 | dest='abort_on_errors', action='store_true', |
141 | help='Abort if a command exits unsuccessfully') | 141 | help='Abort if a command exits unsuccessfully') |
142 | p.add_option('--ignore-missing', action='store_true', | ||
143 | help='Silently skip & do not exit non-zero due missing ' | ||
144 | 'checkouts') | ||
142 | 145 | ||
143 | g = p.add_option_group('Output') | 146 | g = p.add_option_group('Output') |
144 | g.add_option('-p', | 147 | g.add_option('-p', |
@@ -323,6 +326,10 @@ def DoWork(project, mirror, opt, cmd, shell, cnt, config): | |||
323 | cwd = project['worktree'] | 326 | cwd = project['worktree'] |
324 | 327 | ||
325 | if not os.path.exists(cwd): | 328 | if not os.path.exists(cwd): |
329 | # Allow the user to silently ignore missing checkouts so they can run on | ||
330 | # partial checkouts (good for infra recovery tools). | ||
331 | if opt.ignore_missing: | ||
332 | return 0 | ||
326 | if ((opt.project_header and opt.verbose) | 333 | if ((opt.project_header and opt.verbose) |
327 | or not opt.project_header): | 334 | or not opt.project_header): |
328 | print('skipping %s/' % project['relpath'], file=sys.stderr) | 335 | print('skipping %s/' % project['relpath'], file=sys.stderr) |