bisect-kit: add chrome master localbuild bisector and helper scripts
bisector: bisect_cr_localbuild_master.py
switcher: switch_cros_cr_localbuild_master.py
BUG=chromium:776314
TEST=unittest and following commands
(Search the first version of R65, the stupid way)
$ ./bisect_cr_localbuild_master.py init --old 64.0.3280.0 --new 65.0.3299.0 \
--chrome_root ~/chromium
$ ./bisect_cr_localbuild_master.py config switch \
./switch_cros_cr_localbuild_master.py $DUT
$ ./bisect_cr_localbuild_master.py config eval bash -c \
"ssh $DUT /opt/google/chrome/chrome --version | grep 'Chrome 64'"
$ ./bisect_cr_localbuild_master.py run
Change-Id: I0d9f925932094c8a176e6ce50e875b9c8ddd39aa
Reviewed-on: https://chromium-review.googlesource.com/853817
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Kuang-che Wu <kcwu@chromium.org>
Reviewed-by: Kuang-che Wu <kcwu@chromium.org>
diff --git a/bisect_kit/git_util.py b/bisect_kit/git_util.py
index 426406b..0c8e51f 100644
--- a/bisect_kit/git_util.py
+++ b/bisect_kit/git_util.py
@@ -83,3 +83,34 @@
cmd = ['git', 'rev-list', '--reverse', '%s^..%s' % (old, new)]
revlist = util.check_output(*cmd, cwd=git_repo).splitlines()
return revlist
+
+
+def get_commit_log(git_repo, rev):
+ """Get git commit log.
+
+ Args:
+ git_repo: path of git repo.
+ rev: git commit revision.
+
+ Returns:
+ commit log message
+ """
+ cmd = ['git', 'log', '-1', '--format=%B', rev]
+ msg = util.check_output(*cmd, cwd=git_repo)
+ return msg
+
+
+def get_commit_hash(git_root, rev):
+ """Get git commit hash.
+
+ Args:
+ git_repo: path of git repo.
+ rev: could be git tag, branch, or (shortened) commit hash
+
+ Returns:
+ full git commit hash
+ """
+ cmd = ['git', 'rev-parse', rev]
+ git_rev = util.check_output(*cmd, cwd=git_root).strip()
+ assert git_rev
+ return git_rev