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].