aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools/llvm_project.py
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2020-06-24 16:27:44 -0700
committerGeorge Burgess <gbiv@chromium.org>2020-06-24 23:44:11 +0000
commit536aff5f6d015f840bafd6ea70774bbc6b3da6f3 (patch)
tree94820359797af86c9a703fd1d27e9547cb81b673 /llvm_tools/llvm_project.py
parentefb96d1a55f64e72489e219ea65d974e5468a753 (diff)
downloadtoolchain-utils-536aff5f6d015f840bafd6ea70774bbc6b3da6f3.tar.gz
llvm_tools: fix up naming
This replaces `master` with `main` where possible, per the linked bug. Since upstream LLVM has a `master` branch, and there appears to be general support in FOSS for swapping to a different naming convention (`main`), this also makes LLVM's upstream branch name into a constant that we can easily flip if needed. BUG=chromium:1099035 TEST=Unittests Change-Id: I0844cfb4fec00f761e39b0443299daa918fa37ab Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2265047 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'llvm_tools/llvm_project.py')
-rw-r--r--llvm_tools/llvm_project.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm_tools/llvm_project.py b/llvm_tools/llvm_project.py
index c171370c..7937729f 100644
--- a/llvm_tools/llvm_project.py
+++ b/llvm_tools/llvm_project.py
@@ -13,6 +13,7 @@ import subprocess
import sys
import get_llvm_hash
+import git_llvm_rev
def get_location() -> str:
@@ -33,9 +34,13 @@ def ensure_up_to_date():
assert checkout == actual_checkout, '%s != %s' % (actual_checkout, checkout)
commit_timestamp = subprocess.check_output(
- ['git', 'log', '-n1', '--format=%ct', 'origin/master'],
+ [
+ 'git', 'log', '-n1', '--format=%ct',
+ 'origin/' + git_llvm_rev.MAIN_BRANCH
+ ],
cwd=checkout,
- encoding='utf-8')
+ encoding='utf-8',
+ )
commit_time = datetime.datetime.fromtimestamp(int(commit_timestamp.strip()))
now = datetime.datetime.now()
@@ -52,7 +57,7 @@ def ensure_up_to_date():
(time_since_last_commit.days, checkout),
file=sys.stderr)
- result = subprocess.run(['git', 'fetch', 'origin'], cwd=checkout)
+ result = subprocess.run(['git', 'fetch', 'origin'], check=False, cwd=checkout)
if result.returncode:
print(
'Sync failed somehow; hoping that things are fresh enough, then...',