Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(970)

Unified Diff: components/sync/protocol/prepare_protos_for_java_tests.py

Issue 2301063002: Remove custom changes for protobuf retain_unknown_fields (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/protobuf/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/protocol/prepare_protos_for_java_tests.py
diff --git a/components/sync/protocol/prepare_protos_for_java_tests.py b/components/sync/protocol/prepare_protos_for_java_tests.py
index bd836bc0e25c9ef8b52998723576de13be69103c..b24dfa4d044b6dab1df8af48b5766dd5e6451ce8 100755
--- a/components/sync/protocol/prepare_protos_for_java_tests.py
+++ b/components/sync/protocol/prepare_protos_for_java_tests.py
@@ -52,24 +52,19 @@ def ConvertProtoFileContents(contents):
Args:
contents: The contents of a protocol buffer definition file.
"""
- # Remove the retain_unknown_fields option.
- incompatible_option_regex = re.compile(
- r'^\s*option\s+retain_unknown_fields\s*=.*;', re.MULTILINE)
- pruned_contents = incompatible_option_regex.sub('', contents)
-
# Add the java_multiple_files and java_package options. Options must be set
# after the syntax declaration, so look for the declaration and place the
# options immediately after it.
# TODO(pvalenzuela): Set Java options via proto compiler flags instead of
# modifying the files here.
syntax_regex = re.compile(r'^\s*syntax\s*=.*;', re.MULTILINE)
- syntax_end = syntax_regex.search(pruned_contents).end()
+ syntax_end = syntax_regex.search(contents).end()
java_options = (
'option java_multiple_files = true; '
'option java_package = "org.chromium.components.sync.protocol";')
- contents_to_join = (pruned_contents[:syntax_end], java_options,
- pruned_contents[syntax_end:])
+ contents_to_join = (contents[:syntax_end], java_options,
+ contents[syntax_end:])
return ''.join(contents_to_join)
« no previous file with comments | « no previous file | third_party/protobuf/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698