Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: components/policy/proto/PRESUBMIT.py

Issue 137903004: Removed the old policy protobufs location. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/proto/cloud/device_management_local.proto ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/proto/PRESUBMIT.py
diff --git a/components/policy/proto/PRESUBMIT.py b/components/policy/proto/PRESUBMIT.py
deleted file mode 100644
index 50d131414e9d3a1b37f457da83db46867460a380..0000000000000000000000000000000000000000
--- a/components/policy/proto/PRESUBMIT.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# TODO(joaodasilva): remove this file. http://crbug.com/327345
-
-import itertools
-
-def _CheckPolicyProtobufs(input_api, output_api):
- # List of pairs (A, B) where A should equal B.
- file_pairs = [
- ( 'chrome/browser/policy/proto/chromeos/chrome_device_policy.proto',
- 'chrome/browser/chromeos/policy/proto/chrome_device_policy.proto' ),
- ( 'chrome/browser/policy/proto/chromeos/install_attributes.proto',
- 'chrome/browser/chromeos/policy/proto/install_attributes.proto' ),
- ( 'chrome/browser/policy/proto/cloud/chrome_extension_policy.proto',
- 'components/policy/proto/chrome_extension_policy.proto' ),
- ( 'chrome/browser/policy/proto/cloud/device_management_backend.proto',
- 'components/policy/proto/device_management_backend.proto' ),
- ( 'chrome/browser/policy/proto/cloud/device_management_local.proto',
- 'components/policy/proto/device_management_local.proto' ),
- ( 'chrome/browser/policy/proto/PRESUBMIT.py',
- 'components/policy/proto/PRESUBMIT.py' ),
- ( 'chrome/browser/chromeos/policy/proto/PRESUBMIT.py',
- 'components/policy/proto/PRESUBMIT.py' ),
- ]
-
- root = input_api.change.RepositoryRoot()
- results = []
-
- for file_a, file_b in file_pairs:
- path_a = input_api.os_path.join(root, *file_a.split('/'))
- path_b = input_api.os_path.join(root, *file_b.split('/'))
- with open(path_a, 'r') as f_a:
- content_a = f_a.readlines()[3:]
- with open(path_b, 'r') as f_b:
- content_b = f_b.readlines()[3:]
- if content_a != content_b:
- # If you get this error then check |file_pairs| and make sure that the
- # contents of the files in each pair match.
- results.append(output_api.PresubmitError(
- '%s must equal %s. This is temporary until http://crbug.com/327345 '
- 'is fixed.' % (file_a, file_b)))
-
- # If new files are added then |file_pairs| must be updated.
- existing = frozenset(itertools.chain(*file_pairs))
- for f in input_api.AffectedFiles():
- if f.LocalPath() not in existing:
- # If you get this error then add an entry for the new files to
- # |file_pairs|.
- results.append(output_api.PresubmitError(
- 'Please add an entry for %s to %s/PRESUBMIT.py' %
- (f.LocalPath(), input_api.PresubmitLocalPath())))
-
- return results
-
-
-def _CommonChecks(input_api, output_api):
- return _CheckPolicyProtobufs(input_api, output_api)
-
-
-def CheckChangeOnUpload(input_api, output_api):
- return _CommonChecks(input_api, output_api)
-
-
-def CheckChangeOnCommit(input_api, output_api):
- return _CommonChecks(input_api, output_api)
« no previous file with comments | « chrome/browser/policy/proto/cloud/device_management_local.proto ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698