From 34ad23fa0bcb704990c4263816dc6ca3cf362d8d Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 7 Aug 2014 09:23:24 +0000 Subject: [PATCH] Add a new `--force-clean-deps` flag to automate-git.py that deletes/re-downloads all third-party git repos (issue #1348). Should be used in combination with the `--force-clean` flag. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1787 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- tools/automate/automate-git.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/automate/automate-git.py b/tools/automate/automate-git.py index 88a142909..68de316c3 100644 --- a/tools/automate/automate-git.py +++ b/tools/automate/automate-git.py @@ -369,8 +369,12 @@ parser.add_option('--force-config', help='Force creation of a new gclient config file.') parser.add_option('--force-clean', action='store_true', dest='forceclean', default=False, - help='Force a clean CEF checkout. This will trigger a new '+\ - 'update, build and distribution.') + help='Force a clean checkout of Chromium and CEF. This will'+\ + ' trigger a new update, build and distribution.') +parser.add_option('--force-clean-deps', + action='store_true', dest='forcecleandeps', default=False, + help='Force a clean checkout of Chromium dependencies. Used'+\ + ' in combination with --force-clean.') parser.add_option('--dry-run', action='store_true', dest='dryrun', default=False, help="Output commands without executing them.") @@ -799,8 +803,13 @@ if os.path.exists(out_src_dir): # Update the Chromium checkout. if chromium_checkout_changed: if not chromium_checkout_new: - # Revert all changes in the Chromium checkout. - run("gclient revert --nohooks", chromium_dir, depot_tools_dir) + if options.forceclean and options.forcecleandeps: + # Remove all local changes including third-party git checkouts managed by + # gclient. + run("%s clean -dffx" % (git_exe), chromium_src_dir, depot_tools_dir) + else: + # Revert all changes in the Chromium checkout. + run("gclient revert --nohooks", chromium_dir, depot_tools_dir) # Fetch new sources. run("%s fetch" % (git_exe), chromium_src_dir, depot_tools_dir)