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

Unified Diff: tools/auto_bisect/source_control.py

Issue 800143003: Sync android-chrome revision along with chromium on android-chrome platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « tools/auto_bisect/bisect_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/auto_bisect/source_control.py
diff --git a/tools/auto_bisect/source_control.py b/tools/auto_bisect/source_control.py
index 9249f17cbe7495b3aa15a0130202f9e7720b88bd..cebb164f15957179f3380f01cd015030b7fb8923 100644
--- a/tools/auto_bisect/source_control.py
+++ b/tools/auto_bisect/source_control.py
@@ -34,16 +34,32 @@ def GetRevisionList(end_revision_hash, start_revision_hash, cwd=None):
def SyncToRevision(revision, sync_client=None):
+ """Syncs or checks out a revision based on sync_client argument.
+
+ Args:
+ revision: Git hash for the solutions with the format <repo>@rev.
+ E.g., "src@2ae43f...", "src/third_party/webkit@asr1234" etc.
+ sync_client: Syncs to revision when this is True otherwise checks out
+ the revision.
+
+ Returns:
+ True if sync or checkout is successful, False otherwise.
+ """
if not sync_client:
_, return_code = bisect_utils.RunGit(['checkout', revision])
elif sync_client == 'gclient':
- return_code = bisect_utils.RunGClientAndSync(revision)
+ return_code = bisect_utils.RunGClientAndSync([revision])
else:
raise NotImplementedError('Unsupported sync_client: "%s"' % sync_client)
return not return_code
+def GetCurrentRevision(cwd=None):
+ """Gets current revision of the given repository."""
+ return bisect_utils.CheckRunGit(['rev-parse', 'HEAD'], cwd=cwd).strip()
+
+
def ResolveToRevision(revision_to_check, depot, depot_deps_dict,
search, cwd=None):
"""Tries to resolve an SVN revision or commit position to a git SHA1.
« no previous file with comments | « tools/auto_bisect/bisect_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698