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

Unified Diff: tools/auto_bisect/source_control.py

Issue 792183003: Make changes to support bisect for android-chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 7946aa8ec87d2b4c85bad65bab4aa6ce5f5cfb1b..9249f17cbe7495b3aa15a0130202f9e7720b88bd 100644
--- a/tools/auto_bisect/source_control.py
+++ b/tools/auto_bisect/source_control.py
@@ -12,22 +12,6 @@ def IsInGitRepository():
return output.strip() == 'true'
-def SyncToRevisionWithGClient(revision):
- """Uses gclient to sync to the specified revision.
-
- This is like running gclient sync --revision <revision>.
-
- Args:
- revision: A git SHA1 hash or SVN revision number (depending on workflow).
-
- Returns:
- The return code of the call.
- """
- return bisect_utils.RunGClient(
- ['sync', '--verbose', '--reset', '--force',
- '--delete_unversioned_trees', '--nohooks', '--revision', revision])
-
-
def GetRevisionList(end_revision_hash, start_revision_hash, cwd=None):
"""Retrieves a list of git commit hashes in a range.
@@ -53,7 +37,7 @@ def SyncToRevision(revision, sync_client=None):
if not sync_client:
_, return_code = bisect_utils.RunGit(['checkout', revision])
elif sync_client == 'gclient':
- return_code = SyncToRevisionWithGClient(revision)
+ return_code = bisect_utils.RunGClientAndSync(revision)
else:
raise NotImplementedError('Unsupported sync_client: "%s"' % sync_client)
@@ -139,18 +123,20 @@ def GetCommitPosition(git_revision, cwd=None):
"""
# Some of the respositories are pure git based, unlike other repositories
# they doesn't have commit position. e.g., skia, angle.
- no_commit_position_repos = ['angle', 'skia']
- if cwd and any(repo in cwd for repo in no_commit_position_repos):
- return None
-
cmd = ['footers', '--position-num', git_revision]
- output = bisect_utils.CheckRunGit(cmd, cwd)
- commit_position = output.strip()
+ output, return_code = bisect_utils.RunGit(cmd, cwd)
+ if not return_code:
+ commit_position = output.strip()
+ if bisect_utils.IsStringInt(commit_position):
+ return int(commit_position)
+ return None
- if bisect_utils.IsStringInt(commit_position):
- return int(commit_position)
- return None
+def GetCommitTime(git_revision, cwd=None):
+ """Returns commit time for the given revision in UNIX timestamp."""
+ cmd = ['log', '--format=%ct', '-1', git_revision]
+ output = bisect_utils.CheckRunGit(cmd, cwd=cwd)
+ return int(output)
def QueryRevisionInfo(revision, cwd=None):
« 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