Skip to content

Commit 284ada5

Browse files
committed
script/ptl-tool: add --stop-at-built flag
To make modifications to the branch before it is tagged and a branch name created. Signed-off-by: Patrick Donnelly <[email protected]>
1 parent f7624de commit 284ada5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/script/ptl-tool.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
import os
114114
import re
115115
import requests
116+
import signal
116117
import sys
117118

118119
from os.path import expanduser
@@ -360,6 +361,11 @@ def build_branch(args):
360361
sys.exit(1)
361362
log.info("Labeled PR #{pr} {label}".format(pr=pr, label=label))
362363

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+
363369
# If the branch is 'HEAD', leave HEAD detached (but use "main" for commit message)
364370
if branch == 'HEAD':
365371
log.info("Leaving HEAD detached; no branch anchors your commits")
@@ -400,6 +406,7 @@ def main():
400406
parser.add_argument('--label', dest='label', action='store', default=default_label, help='label PRs for testing')
401407
parser.add_argument('--pr-label', dest='pr_label', action='store', help='label PRs for testing')
402408
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')
403410
parser.add_argument('prs', metavar="PR", type=int, nargs='*', help='Pull Requests to merge')
404411
args = parser.parse_args(argv)
405412
return build_branch(args)

0 commit comments

Comments
 (0)