From 351ed7a937eb2a79390b12970044bf79825675a2 Mon Sep 17 00:00:00 2001 From: Barosl Lee Date: Mon, 15 Dec 2014 10:29:00 +0900 Subject: [PATCH] Parse the commands more generously r+, r=me, r=[name], r-, and retry are checked more generously. --- bors.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bors.py b/bors.py index 842f980..7a148d7 100755 --- a/bors.py +++ b/bors.py @@ -308,11 +308,11 @@ def last_comment(self): def approval_list(self): return ([u for (d,u,c) in self.head_comments - if (c.startswith("r+") or - c.startswith("r=me"))] + + # Check if "r+" or "r=me" + for m in [re.search(r'\b(?:r\+|r=me\b)', c)] if m] + [ m.group(1) for (_,_,c) in self.head_comments - for m in [re.match(r"^r=(\w+)", c)] if m ]) + for m in [re.search(r'\b(?:r=(\w+))\b', c)] if m ]) def batched(self): for date, user, comment in self.head_comments: @@ -336,11 +336,11 @@ def prioritized_state(self): def disapproval_list(self): return [u for (d,u,c) in self.head_comments - if c.startswith("r-")] + for m in [re.search(r'\b(?:r-)', c)] if m] def count_retries(self): - return len([c for (d,u,c) in self.head_comments if ( - c.startswith("@bors: retry"))]) + return len([c for (d,u,c) in self.head_comments + for m in [re.search(r'\b(?:retry)\b', c)] if m]) # annoyingly, even though we're starting from a "pull" json # blob, this blob does not have the "mergeable" flag; only