Presubmit: add PRESUBMIT=false to non-master branch changes
authorborenet <borenet@google.com>
Thu, 4 Jun 2015 22:15:42 +0000 (15:15 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 4 Jun 2015 22:15:42 +0000 (15:15 -0700)
BUG=skia:

Review URL: https://codereview.chromium.org/1161973005

PRESUBMIT.py

index 6d429df..5599c31 100644 (file)
@@ -343,6 +343,8 @@ def PostUploadHook(cl, change, output_api):
     need to be gated on the master branch's tree.
   * Adds 'NOTRY=true' for non master branch changes since trybots do not yet
     work on them.
+  * Adds 'NOPRESUBMIT=true' for non master branch changes since those don't
+    run the presubmit checks.
   """
 
   results = []
@@ -405,6 +407,12 @@ def PostUploadHook(cl, change, output_api):
             output_api.PresubmitNotifyResult(
                 'Trybots do not yet work for non-master branches. '
                 'Automatically added \'NOTRY=true\' to the CL\'s description'))
+      if not re.search(
+          r'^NOPRESUBMIT=true$', new_description, re.M | re.I):
+        new_description += "\nNOPRESUBMIT=true"
+        results.append(
+            output_api.PresubmitNotifyResult(
+                'Branch changes do not run the presubmit checks.'))
 
     # Read and process the HASHTAGS file.
     hashtags_fullpath = os.path.join(change._local_root, 'HASHTAGS')