Skip to content

Commit 2e2ebaa

Browse files
committed
Remove duplicates before reporting and saving to JSON
1 parent 0c8dbfd commit 2e2ebaa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

needs_backport.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,17 @@ def main() -> None:
167167
api, args.repo_path, branch, args.start, args.number, args.sort
168168
)
169169
for reason, prs in candidates.items():
170+
# Remove duplicates
171+
prs = [pr for pr in prs if pr not in total_candidates[reason]]
170172
total_candidates[reason].extend(prs)
171173

172174
# Report
173175
def report(prs: list[PR]):
174176
if prs:
175-
seen = set()
176177
cmd = "open "
177178
for pr in prs:
178-
if pr["number"] in seen:
179-
continue
180179
print(f'\\[#{pr["number"]}]({pr["html_url"]}) {pr["title"]}')
181180
cmd += f"{pr['html_url']} "
182-
seen.add(pr["number"])
183181
print()
184182
print(cmd)
185183
if args.open_prs:

0 commit comments

Comments
 (0)