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 <prashanthsw@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
This commit is contained in:
Prashanth Swaminathan 2023-05-27 11:24:16 -07:00 committed by libyuv LUCI CQ
parent 4b6373d189
commit 564dca8cc5

View File

@ -218,7 +218,14 @@ def BuildDepsentryDict(deps_dict):
else: else:
deps_url = deps_url_spec deps_url = deps_url_spec
if not path in result: 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) result[path] = DepsEntry(path, url, revision)
AddDepsEntries(deps_dict['deps']) AddDepsEntries(deps_dict['deps'])