|
113 | 113 | import os |
114 | 114 | import re |
115 | 115 | import requests |
| 116 | +import signal |
116 | 117 | import sys |
117 | 118 |
|
118 | 119 | from os.path import expanduser |
@@ -360,6 +361,11 @@ def build_branch(args): |
360 | 361 | sys.exit(1) |
361 | 362 | log.info("Labeled PR #{pr} {label}".format(pr=pr, label=label)) |
362 | 363 |
|
| 364 | + if args.stop_at_built: |
| 365 | + log.warning("Stopping execution (SIGSTOP) with built branch for further modification. Foreground when execution should resume (typically `fg`).") |
| 366 | + signal.raise_signal(signal.SIGSTOP) |
| 367 | + log.warning("Resuming execution.") |
| 368 | + |
363 | 369 | # If the branch is 'HEAD', leave HEAD detached (but use "main" for commit message) |
364 | 370 | if branch == 'HEAD': |
365 | 371 | log.info("Leaving HEAD detached; no branch anchors your commits") |
@@ -400,6 +406,7 @@ def main(): |
400 | 406 | parser.add_argument('--label', dest='label', action='store', default=default_label, help='label PRs for testing') |
401 | 407 | parser.add_argument('--pr-label', dest='pr_label', action='store', help='label PRs for testing') |
402 | 408 | parser.add_argument('--no-credits', dest='credits', action='store_false', help='skip indication search (Reviewed-by, etc.)') |
| 409 | + parser.add_argument('--stop-at-built', dest='stop_at_built', action='store_true', help='stop execution when branch is built') |
403 | 410 | parser.add_argument('prs', metavar="PR", type=int, nargs='*', help='Pull Requests to merge') |
404 | 411 | args = parser.parse_args(argv) |
405 | 412 | return build_branch(args) |
|
0 commit comments