[upstream_utils] Use "git am" instead of "git apply" for patches (#4248)

This creates actual commits in the thirdparty repo, which makes rebasing
them onto new versions much easier.
This commit is contained in:
Tyler Veness
2022-05-18 12:23:15 -07:00
committed by GitHub
parent 4253d6d5f0
commit 8bd614bb1e
6 changed files with 136 additions and 90 deletions

View File

@@ -3,7 +3,7 @@
import os
import shutil
from upstream_utils import setup_upstream_repo, comment_out_invalid_includes, walk_cwd_and_copy_if, apply_patches
from upstream_utils import setup_upstream_repo, comment_out_invalid_includes, walk_cwd_and_copy_if, am_patches
def main():
@@ -11,6 +11,14 @@ def main():
"v0.37.0")
wpimath = os.path.join(root, "wpimath")
prefix = os.path.join(root, "upstream_utils/drake_patches")
am_patches(repo, [
os.path.join(prefix, "0001-Replace-Eigen-Dense-with-Eigen-Core.patch"),
os.path.join(
prefix,
"0002-Add-WPILIB_DLLEXPORT-to-DARE-function-declarations.patch")
])
# Delete old install
for d in [
"src/main/native/cpp/drake", "src/main/native/include/drake",
@@ -61,11 +69,6 @@ def main():
os.path.join(wpimath, "src/test/native/include")
])
apply_patches(root, [
"upstream_utils/drake-replace-dense-with-core.patch",
"upstream_utils/drake-dllexport-dare.patch"
])
if __name__ == "__main__":
main()