From f3751949deae8e733f1408fb3faf89c8eb8c19ec Mon Sep 17 00:00:00 2001 From: "sergiyb@chromium.org" Date: Thu, 25 Jun 2015 19:15:34 +0000 Subject: [PATCH] Use virtualenv to run commit_queue script R=pgervais@chromium.org BUG=503067 Review URL: https://codereview.chromium.org/1195423002. git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295843 0039d316-1c4b-4281-b951-d872f2087c98 --- commit_queue | 6 +++++- commit_queue.bat | 5 ++++- third_party/cq_client/cq_pb2.py | 19 +++++-------------- third_party/cq_client/validate_config.py | 6 +----- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/commit_queue b/commit_queue index db8b9048e..a634371f8 100755 --- a/commit_queue +++ b/commit_queue @@ -5,4 +5,8 @@ base_dir=$(dirname "$0") -PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/commit_queue.py" "$@" +if [[ "#grep#fetch#cleanup#diff#" != *"#$1#"* ]]; then + "$base_dir"/update_depot_tools "$@" +fi + +PYTHONDONTWRITEBYTECODE=1 exec "$base_dir/ENV/bin/python" "$base_dir/commit_queue.py" "$@" diff --git a/commit_queue.bat b/commit_queue.bat index 5f6baa379..76018a67d 100755 --- a/commit_queue.bat +++ b/commit_queue.bat @@ -7,5 +7,8 @@ setlocal :: This is required with cygwin only. PATH=%~dp0;%PATH% +:: Synchronize the root directory before deferring control back to gclient.py. +call "%~dp0\update_depot_tools.bat" %* + :: Defer control. -%~dp0python "%~dp0\commit_queue.py" %* +%~dp0\ENV\bin\python "%~dp0\commit_queue.py" %* diff --git a/third_party/cq_client/cq_pb2.py b/third_party/cq_client/cq_pb2.py index ff5336429..f31788569 100644 --- a/third_party/cq_client/cq_pb2.py +++ b/third_party/cq_client/cq_pb2.py @@ -1,22 +1,13 @@ -# This file was originally generated by the protocol buffer compiler 2.6.1, but -# was subsequently manually edited to import protobuf26 instead of -# google.protobuf. If you need to re-generate this file, please make similar -# changes again and add this comment back. More details on why we chose to -# rename the package can be found in the file -# depot_tools/third_party/protobuf26/README.chromium -# Example CL updating the references: -# https://codereview.chromium.org/1162993005/ - # Generated by the protocol buffer compiler. DO NOT EDIT! # source: cq.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from protobuf26 import descriptor as _descriptor -from protobuf26 import message as _message -from protobuf26 import reflection as _reflection -from protobuf26 import symbol_database as _symbol_database -from protobuf26 import descriptor_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() diff --git a/third_party/cq_client/validate_config.py b/third_party/cq_client/validate_config.py index 1e34b868e..17d91dbb3 100644 --- a/third_party/cq_client/validate_config.py +++ b/third_party/cq_client/validate_config.py @@ -6,11 +6,7 @@ """CQ config validation library.""" import argparse -# The 'from google import protobuf' below was replaced to fix an issue where -# some users may have built-in google package installed on their system, which -# is incompatible with cq_pb2 below. This hack can be removed after -# http://crbug.com/503067 is resolved. -import protobuf26 as protobuf +from google import protobuf import logging import re import sys