Skip to content

Commit a151711

Browse files
committed
Add '--remove-pr-references' to 'git-obs staging group' command
1 parent 99d2633 commit a151711

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

osc/commands_git/staging_group.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ def init_arguments(self):
3232
help="Branch in the fork used to create a new pull request. Defaults to 'for/<target_branch>/group-YYYY-MM-DD_HH-MM-SS'. Conflicts with --target."
3333
)
3434

35+
self.add_argument(
36+
"--remove-pr-references",
37+
action="store_true",
38+
help="Remove 'PR:' references from the source project pull requests",
39+
)
40+
3541
self.add_argument(
3642
"--force",
3743
action="store_true",
@@ -218,11 +224,12 @@ def run(self, args):
218224

219225
for owner, repo, number in args.pr_list:
220226
pr = pr_map[(owner, repo, number)]
221-
try:
222-
# apply the removed 'PR:' reference to the package pull request
223-
pr.pr_obj.set(self.gitea_conn, owner, repo, number, description=pr.pr_obj.body)
224-
except Exception as e:
225-
print(f"Unable to remove 'PR:' references from pull request {owner}/{repo}#{number}: {e}")
227+
if args.remove_pr_references:
228+
try:
229+
# apply the removed 'PR:' reference to the package pull request
230+
pr.pr_obj.set(self.gitea_conn, owner, repo, number, description=pr.pr_obj.body)
231+
except Exception as e:
232+
print(f"Unable to remove 'PR:' references from pull request {owner}/{repo}#{number}: {e}")
226233

227234
# close the pull request that was merged into the target
228235
try:

0 commit comments

Comments
 (0)