Commit ccf8bc42 authored by Hans Wennborg's avatar Hans Wennborg Committed by Commit Bot

Make upload_revision.py do a git checkout so it can get the commit count

And make sure that the 'n' prefix gets used properly.

TBR=thakis

Bug: 1017736
Change-Id: I9d65fd468ec4d58ab7ddf3ce35160e13f518514e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879227Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709107}
parent 8e542333
......@@ -148,7 +148,9 @@ def GetLatestLLVMCommit():
def GetCommitCount(commit):
"""Get the number of commits from FIRST_LLVM_COMMIT to commit."""
"""Get the number of commits from FIRST_LLVM_COMMIT to commit.
Needs to be called from inside the git repository dir."""
return subprocess.check_output(['git', 'rev-list', '--count',
FIRST_LLVM_COMMIT + '..' + commit]).rstrip()
......
......@@ -18,7 +18,8 @@ import shutil
import subprocess
import sys
from build import GetCommitCount
from build import GetCommitCount, CheckoutLLVM, LLVM_DIR
from update import CHROMIUM_DIR
# Path constants.
THIS_DIR = os.path.dirname(__file__)
......@@ -66,14 +67,18 @@ def main():
args = parser.parse_args()
clang_git_revision = args.clang_git_revision[0]
clang_svn_revision = GetCommitCount(clang_git_revision)
# To get the commit count, we need a checkout.
CheckoutLLVM(clang_git_revision, LLVM_DIR);
clang_svn_revision = 'n' + GetCommitCount(clang_git_revision)
clang_sub_revision = args.clang_sub_revision
# Needs shell=True on Windows due to git.bat in depot_tools.
os.chdir(CHROMIUM_DIR)
git_revision = subprocess.check_output(
["git", "rev-parse", "origin/master"], shell=is_win).strip()
print("Making a patch for Clang n{}-{}-{}".format(
print("Making a patch for Clang {}-{}-{}".format(
clang_svn_revision, clang_git_revision[:8], clang_sub_revision))
print("Chrome revision: {}".format(git_revision))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment