Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1587)

Unified Diff: checkout.py

Issue 171763003: Apply Issue shim for disabling checkout when bot update ran. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Add --force flag and --git_ref flag Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apply_issue.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: checkout.py
diff --git a/checkout.py b/checkout.py
index 450b37973c0e0c702fe328e8f2759986b8b08fcf..cc570082c01219def42be817a84c0296ac950104 100644
--- a/checkout.py
+++ b/checkout.py
@@ -553,8 +553,9 @@ class SvnCheckout(CheckoutBase, SvnMixIn):
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 @@ class GitCheckout(CheckoutBase):
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))
« no previous file with comments | « apply_issue.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698