From c7b0b8e21c8c99dfdbe1590f9cf9c2e7f6309e82 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 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bors.py b/bors.py index 842f980..35db999 100755 --- a/bors.py +++ b/bors.py @@ -308,11 +308,10 @@ 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"))] + + if 'r+' in c or 'r=me' in c] + [ 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 +335,11 @@ def prioritized_state(self): def disapproval_list(self): return [u for (d,u,c) in self.head_comments - if c.startswith("r-")] + if 'r-' in c] 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