From 982cfc2f33f8190728363c5ecdc55fbbab1ea40e Mon Sep 17 00:00:00 2001 From: Amir Sarabadani Date: Fri, 26 Apr 2024 18:43:52 +0200 Subject: [PATCH] patchforreview_remover: Update for adding the # to patch numbers See T358940 and T363573 Bug: T363573 --- patchforreview_remover.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patchforreview_remover.py b/patchforreview_remover.py index e575a74..97ea5ef 100755 --- a/patchforreview_remover.py +++ b/patchforreview_remover.py @@ -43,10 +43,10 @@ class Checker(): return "close" # Gerrit style - if re.search(r"Change \d+ had a related patch set uploaded", raw_comment): + if re.search(r"Change #?\d+ had a related patch set uploaded", raw_comment): return "open" - if re.search(r'Change \d+ \*\*(?:merged|abandoned)\*\* by ', raw_comment): + if re.search(r'Change #?\d+ \*\*(?:merged|abandoned)\*\* by ', raw_comment): return "close" return None @@ -94,7 +94,7 @@ class Checker(): for patch in gerrit_patch_status: # The normal sequence of GerritBot transactions for a Gerrit change is "Change # \d+ had a related patch set uploaded" (indicated by True in - # gerrit_patch_status) eventually followed by "Change \d+ (merged|abandoned) + # gerrit_patch_status) eventually followed by "Change #?\d+ (merged|abandoned) # by whoever" (indicated by False in gerrit_patch_status). The transactions # are returned in reverse order so the opened/merged pattern will appear as # the reverse of [True, False], which is [False, True].