From 564dca8cc525ccd0a5e83f8295c1cf01a1107462 Mon Sep 17 00:00:00 2001 From: Prashanth Swaminathan Date: Sat, 27 May 2023 11:24:16 -0700 Subject: [PATCH] Handle DEPS targets that target the HEAD revision Some targets in DEPS files do not specify a revision and always pull the HEAD revision instead. In these cases, the URL is not split by '@'. Handle these cases by assuming HEAD. Test: Verified local roll attempt does not fail when processing DEPS. Change-Id: I649195d90933ed58a18d76c20ac7d80ab01c295d Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4568777 Commit-Queue: Prashanth Swaminathan Reviewed-by: Mirko Bonadei --- tools_libyuv/autoroller/roll_deps.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools_libyuv/autoroller/roll_deps.py b/tools_libyuv/autoroller/roll_deps.py index 5496e4240..4f3811cca 100755 --- a/tools_libyuv/autoroller/roll_deps.py +++ b/tools_libyuv/autoroller/roll_deps.py @@ -218,7 +218,14 @@ def BuildDepsentryDict(deps_dict): else: deps_url = deps_url_spec if not path in result: - url, revision = deps_url.split('@') if deps_url else (None, None) + if not deps_url: + url, revision = None, None + elif '@' not in deps_url: + # Some dependencies always pull in the latest revision and do not have + # a revision in the URL. Assume 'HEAD' in these cases. + url, revision = deps_url, 'HEAD' + else: + url, revision = deps_url.split('@') result[path] = DepsEntry(path, url, revision) AddDepsEntries(deps_dict['deps'])