Fix autoroller not to miss writing to DEPS of variable changes.

In the previous commit, I changed to modify deps_content,
but it was no-op since the content was already written to the DEPS file.

Bug: None
Change-Id: I278fbbb628422a42e616708f00529e935d75cd1f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/292660
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Christoffer Jansson <jansson@google.com>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#39268}
This commit is contained in:
Byoungchan Lee 2023-02-08 17:39:30 +09:00 committed by WebRTC LUCI CQ
parent e8ac5af787
commit cd489a06ab

View File

@ -570,13 +570,17 @@ def UpdateDepsFile(deps_filename, rev_update, changed_deps, new_cr_content):
(ANDROID_DEPS_START, ANDROID_DEPS_END, faulty))
deps_content = deps_re.sub(new_deps.group(0), deps_content)
for dep in changed_deps:
if isinstance(dep, ChangedVersionEntry):
deps_content = deps_content.replace(dep.current_version, dep.new_version)
with open(deps_filename, 'wb') as deps_file:
deps_file.write(deps_content.encode('utf-8'))
# Update each individual DEPS entry.
for dep in changed_deps:
# ChangedVersionEntry types are already been processed.
if isinstance(dep, ChangedVersionEntry):
deps_content = deps_content.replace(dep.current_version, dep.new_version)
continue
local_dep_dir = os.path.join(CHECKOUT_ROOT_DIR, dep.path)
if not os.path.isdir(local_dep_dir):