1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 def _CheckCodeMirrorChanges(input_api
, output_api
):
7 errorText
= ("ERROR: Attempt to modify CodeMirror. The only allowed changes are "
8 "rolls from the upstream (http://codemirror.net). If this is a roll, "
9 "make sure you mention 'roll CodeMirror' (no quotes) in the change description.\n"
10 "CodeMirror rolling instructions:\n"
11 " https://sites.google.com/a/chromium.org/devtools-codemirror-rolling")
12 changeDescription
= input_api
.change
.DescriptionText()
14 if "roll codemirror" not in changeDescription
.lower():
15 errors
.append(output_api
.PresubmitError(errorText
))
19 def CheckChangeOnUpload(input_api
, output_api
):
21 results
.extend(_CheckCodeMirrorChanges(input_api
, output_api
))