Apply Issue changes for disabling checkout when bot update ran.

This add --force to ignore the flag file.
This also passes --base_ref so we can specify which ref we're basing off of so that it does not incorrectly assert that it is basing off origin/master

BUG=339171

Review URL: https://codereview.chromium.org/171763003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@252464 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/checkout.py b/checkout.py
index 450b379..cc57008 100644
--- a/checkout.py
+++ b/checkout.py
@@ -553,8 +553,9 @@
 class GitCheckout(CheckoutBase):
   """Manages a git checkout."""
   def __init__(self, root_dir, project_name, remote_branch, git_url,
-      commit_user, post_processors=None):
+      commit_user, post_processors=None, base_ref=None):
     super(GitCheckout, self).__init__(root_dir, project_name, post_processors)
+    self.base_ref = base_ref
     self.git_url = git_url
     self.commit_user = commit_user
     self.remote_branch = remote_branch
@@ -710,9 +711,13 @@
     if verbose:
       cmd.append('--verbose')
     self._check_call_git(cmd)
+    if self.base_ref:
+      base_ref = self.base_ref
+    else:
+      base_ref = '%s/%s' % (self.remote,
+                            self.remote_branch or self.master_branch)
     found_files = self._check_output_git(
-        ['diff', '%s/%s' % (self.remote,
-                            self.remote_branch or self.master_branch),
+        ['diff', base_ref,
          '--name-only']).splitlines(False)
     assert sorted(patches.filenames) == sorted(found_files), (
         sorted(patches.filenames), sorted(found_files))