From 35cfa28972766954e81cad2ffa5c538545a88e13 Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 31 May 2018 22:44:05 +0800 Subject: [PATCH] Do not allow `bors try` after it has been `bors r+`'ed. Fix #3. --- homu/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/homu/main.py b/homu/main.py index 0ed3d80..9827b38 100644 --- a/homu/main.py +++ b/homu/main.py @@ -642,6 +642,14 @@ def parse_commands(body, username, repo_cfg, state, my_username, db, states, elif word in ['try', 'try-'] and realtime: if not _try_auth_verified(): continue + if state.status == '' and state.approved_by: + state.add_comment( + ':no_good: ' + 'Please do not `try` after a pull request has been `r+`ed.' + ' If you need to `try`, unapprove (`r-`) it first.' + ) + continue + state.try_ = word == 'try' state.merge_sha = ''