Index: verification/tree_status.py |
=================================================================== |
--- verification/tree_status.py (revision 234872) |
+++ verification/tree_status.py (working copy) |
@@ -7,6 +7,7 @@ |
import calendar |
import json |
import logging |
+import re |
import ssl |
import time |
import urllib2 |
@@ -56,6 +57,12 @@ |
return u'Tree is currently not open: %s' % self.last_tree_status |
+class AlwaysOpenTreeStatus(TreeStatus): |
+ """Used when tree status does not need to be checked.""" |
+ def postpone(self): |
+ return False |
+ |
+ |
class TreeStatusVerifier(base.Verifier): |
"""Checks the tree status before allowing a commit.""" |
name = 'tree status' |
@@ -65,8 +72,15 @@ |
self.tree_status_url = tree_status_url |
def verify(self, pending): |
- pending.verifications[self.name] = TreeStatus( |
- tree_status_url=self.tree_status_url, issue=pending.issue) |
+ if re.search(r'(?im)^NOTREECHECKS=TRUE$', pending.description): |
+ # Use a TreeStatus instance that always returns False for postpone(). |
+ tree_status = AlwaysOpenTreeStatus() |
+ else: |
+ tree_status = TreeStatus( |
+ tree_status_url=self.tree_status_url, issue=pending.issue) |
+ pending.verifications[self.name] = tree_status |
+ |
def update_status(self, queue): |
pass |
+ |