Commit 1833e57b authored by maruel@chromium.org's avatar maruel@chromium.org

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
parent b0f852f3
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment