Spanify plugin: fix patches not getting unescaped
crrev.com/c/5875412 introduced escaping. It unescaped the stdout output but it didn't unescape the individual patches. This CL moves the unescaping to the parsing of the input. Change-Id: Iaf33d5cb76f092db71d6969147d45feaa2340095 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5960698 Reviewed-by: Takashi Sakamoto <tasak@google.com> Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Cr-Commit-Position: refs/heads/main@{#1374569}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
e80a0d6dfa
commit
cf3dbd4355
@ -147,6 +147,10 @@ class Node:
|
||||
|
||||
node = Node(*x)
|
||||
|
||||
# replacement and include_directive fields are percent-encoded.
|
||||
node.replacement = urllib.parse.unquote(node.replacement)
|
||||
node.include_directive = urllib.parse.unquote(node.include_directive)
|
||||
|
||||
# Deduplicate nodes, as they might appear multiple times in the input.
|
||||
if (Node.key_to_node.get(node.replacement) is None):
|
||||
Node.key_to_node[node.replacement] = node
|
||||
@ -382,7 +386,7 @@ def main():
|
||||
|
||||
for index, component in enumerate(component_with_changes):
|
||||
for text in component.changes:
|
||||
print(urllib.parse.unquote(text).replace('\n', '\0'))
|
||||
print(text.replace('\n', '\0'))
|
||||
|
||||
summary_file.write(f'patch_{index}: {len(component.changes)}\n')
|
||||
|
||||
|
Reference in New Issue
Block a user