Add option for GeneratePatch with adapter type override
commita449ab5a4ba6304498d9a3c73b2510e6e7305d96
authorAlex Zhavnerchik <azhavnerchik@meta.com>
Sat, 22 Oct 2022 05:06:14 +0000 (21 22:06 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 22 Oct 2022 05:06:14 +0000 (21 22:06 -0700)
tree5b737b4272e0ac35dbb089bcf52673d59fc49cc0
parent2cd5d40e77c7f4a958317d87984935bd2cd1e867
Add option for GeneratePatch with adapter type override

Summary:
This will allow to make some patches Assign and Clear only to break
type dependency cycles. This will unblock container element patching.

Reviewed By: Alfus

Differential Revision: D40576283

fbshipit-source-id: 8a321bf1f479f06b48af59b837020d5a0e9abb2d
96 files changed:
third-party/thrift/src/thrift/compiler/sema/patch_mutator.cc
third-party/thrift/src/thrift/compiler/sema/patch_mutator.h
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/AssignOnlyPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/Bar.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/BarFieldPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/BarPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/Loop.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/LoopFieldPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/LoopPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/MyStructFieldN28Patch.java
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/MyStructFieldN29Patch.java
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/MyStructFieldN30Patch.java
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/Recursive.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/RecursiveFieldN1Patch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/RecursiveFieldPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-android/test/fixtures/patch/RecursivePatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-cpp2/module_data.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-cpp2/module_data.h
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-cpp2/module_for_each_field.h
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-cpp2/module_metadata.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-cpp2/module_metadata.h
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-cpp2/module_types.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-cpp2/module_types.h
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-cpp2/module_types.tcc
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-cpp2/module_visit_by_thrift_field_metadata.h
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-go/module/ttypes.go
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-go/thrift/lib/thrift/patch/ttypes.go
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-hack/module_types.php
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-hack/patch_types.php
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/Bar.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/BarFieldPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/BarPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/Loop.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/LoopFieldPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/LoopPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/Recursive.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/RecursiveFieldN1Patch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/RecursiveFieldPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/RecursivePatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/__fbthrift_TypeList_105404a0.java [moved from third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/__fbthrift_TypeList_c6fa3293.java with 71% similarity]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/com/facebook/thrift/op/AssignOnlyPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/Bar.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/BarFieldPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/BarPatch.java [copied from third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/MyStructFieldN29Patch.java with 51% similarity]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/Loop.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/LoopFieldPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/LoopPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/MyStructFieldN28Patch.java
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/MyStructFieldN29Patch.java
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/MyStructFieldN30Patch.java
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/Recursive.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/RecursiveFieldN1Patch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/RecursiveFieldPatch.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/RecursivePatch.java [copied from third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-javadeprecated/test/fixtures/patch/MyStructFieldN29Patch.java with 51% similarity]
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-json/module.json
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-json/patch.json
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-json_experimental/module.json
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-json_experimental/patch.json
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py/module/constants.py
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py/module/ttypes.py
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py/thrift/lib/thrift/patch/constants.py
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py/thrift/lib/thrift/patch/ttypes.py
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/apache/thrift/op/patch/builders.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/apache/thrift/op/patch/builders.pyi
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/apache/thrift/op/patch/builders.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/apache/thrift/op/patch/types.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/apache/thrift/op/patch/types.pyi
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/apache/thrift/op/patch/types.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/apache/thrift/op/patch/types_fields.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/apache/thrift/op/patch/types_fields.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/apache/thrift/op/patch/types_reflection.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/apache/thrift/op/patch/types_reflection.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/module/metadata.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/module/types.h
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/patch/metadata.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/patch/types.h
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/test/fixtures/patch/module/builders.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/test/fixtures/patch/module/builders.pyi
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/test/fixtures/patch/module/builders.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/test/fixtures/patch/module/types.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/test/fixtures/patch/module/types.pyi
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/test/fixtures/patch/module/types.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/test/fixtures/patch/module/types_fields.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/test/fixtures/patch/module/types_fields.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/test/fixtures/patch/module/types_reflection.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-py3/test/fixtures/patch/module/types_reflection.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-python/apache/thrift/op/patch/thrift_metadata.py
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-python/apache/thrift/op/patch/thrift_types.py
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-python/apache/thrift/op/patch/thrift_types.pyi
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-python/test/fixtures/patch/module/thrift_metadata.py
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-python/test/fixtures/patch/module/thrift_types.py
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-python/test/fixtures/patch/module/thrift_types.pyi
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-rust/types.rs
third-party/thrift/src/thrift/compiler/test/fixtures/patch/src/module.thrift
third-party/thrift/src/thrift/lib/thrift/patch.thrift
third-party/thrift/src/thrift/test/StructPatchTest.thrift