From 1833e57b477d526dfbd0ba514da149fe9a2384ea Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Mon, 17 Sep 2012 13:21:13 +0000 Subject: [PATCH] When a DEPS file is modified, run gclient sync. It runs it by specifying BASE/HEAD to stay at the current revision. This works around the lack of gclient sync when a DEPS file is applied on the Try Server when triggered from Rietveld. This was handled my the Try Server inside scripts/slave/chromium_command.py manually in the case a 'patch' is specified. TBR=rogerta@chromium.org BUG= Review URL: https://chromiumcodereview.appspot.com/10918264 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@157110 0039d316-1c4b-4281-b951-d872f2087c98 --- apply_issue.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apply_issue.py b/apply_issue.py index bcaa6f267..3b3f1f4c1 100755 --- a/apply_issue.py +++ b/apply_issue.py @@ -10,6 +10,7 @@ import getpass import logging import optparse import os +import subprocess import sys import urllib2 @@ -17,6 +18,7 @@ import breakpad # pylint: disable=W0611 import checkout import fix_encoding +import gclient_utils import rietveld import scm @@ -109,6 +111,16 @@ def main(): except checkout.PatchApplicationFailed, e: print >> sys.stderr, str(e) return 1 + + if 'DEPS' in map(os.path.basename, patchset.filenames): + gclient_root = gclient_utils.FindGclientRoot(options.root_dir) + if gclient_root and scm_type: + print( + 'A DEPS file was updated inside a gclient checkout, running gclient ' + 'sync.') + base_rev = 'BASE' if scm_type == 'svn' else 'HEAD' + return subprocess.call( + ['gclient', 'sync', '--revision', base_rev], cwd=gclient_root) return 0