Skip to content

Commit

Permalink
Parse the commands more generously
Browse files Browse the repository at this point in the history
r+, r=me, r=[name], r-, and retry are checked more generously.
  • Loading branch information
barosl committed Dec 15, 2014
1 parent 5a1a6b6 commit 93e89f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 93e89f1

Please sign in to comment.