From 3da202a5b9fca6ab4517f9bca81e86a8248a3cfb Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 6 Jun 2014 19:14:56 +0000 Subject: [PATCH] Force revert local changes when using the --force-clean switch (issue #1300). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1720 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- tools/automate/automate-git.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/automate/automate-git.py b/tools/automate/automate-git.py index 148147922..88a142909 100644 --- a/tools/automate/automate-git.py +++ b/tools/automate/automate-git.py @@ -650,7 +650,9 @@ if not options.noupdate and os.path.exists(cef_dir): run('%s fetch' % (git_exe), cef_dir, depot_tools_dir) # Checkout the requested branch. - run('%s checkout %s' % (git_exe, cef_checkout), cef_dir, depot_tools_dir) + run('%s checkout %s%s' % + (git_exe, ('--force ' if options.forceclean else ''), cef_checkout), \ + cef_dir, depot_tools_dir) else: cef_current_info = get_svn_info(cef_dir) if cef_current_info['url'] != cef_url: @@ -804,8 +806,9 @@ if chromium_checkout_changed: run("%s fetch" % (git_exe), chromium_src_dir, depot_tools_dir) # Checkout the requested branch. - run("%s checkout %s" % (git_exe, chromium_checkout), chromium_src_dir, \ - depot_tools_dir) + run("%s checkout %s%s" % \ + (git_exe, ('--force ' if options.forceclean else ''), chromium_checkout), \ + chromium_src_dir, depot_tools_dir) if cef_branch != 'trunk': # Remove the 'src' entry from .DEPS.git for release branches. @@ -814,8 +817,9 @@ if chromium_checkout_changed: remove_deps_entry(deps_path, "'src'") # Update third-party dependencies including branch/tag information. - run("gclient sync %s--with_branch_heads --jobs 16" % \ - ('--nohooks ' if chromium_nohooks else ''), \ + run("gclient sync %s%s--with_branch_heads --jobs 16" % \ + (('--reset ' if options.forceclean else ''), \ + ('--nohooks ' if chromium_nohooks else '')), \ chromium_dir, depot_tools_dir) # Delete the src/out directory created by `gclient sync`.