From e45001c0d0555546591a384a9721e403e0d953b4 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Wed, 4 May 2022 01:41:30 +0800 Subject: [PATCH] tools: Support import from any branch --- tools/exclude.txt | 2 +- tools/import-upstream.sh | 5 +++-- tools/include.txt | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/exclude.txt b/tools/exclude.txt index fb8bc408f3..15296c171c 100644 --- a/tools/exclude.txt +++ b/tools/exclude.txt @@ -5,7 +5,7 @@ *_perftest.cc *_test.cc *fuzz* -*src/org/chromium* +*org/chromium* *.golden *.javap* *.pyc diff --git a/tools/import-upstream.sh b/tools/import-upstream.sh index b3c1963c04..c3737e7622 100755 --- a/tools/import-upstream.sh +++ b/tools/import-upstream.sh @@ -9,11 +9,12 @@ name="chromium-$want_version" tarball="$name.tar.xz" url="https://commondatastorage.googleapis.com/chromium-browser-official/$tarball" root=$(git rev-list --max-parents=0 HEAD) +branch=$(git branch --show-current) git config core.autocrlf false git config core.safecrlf false git -c advice.detachedHead=false checkout $root rm -rf src -git checkout master -- tools +git checkout "$branch" -- tools sed -i "s/^\^/$name\//" tools/include.txt if [ -f "/tmp/$tarball" ]; then cat "/tmp/$tarball" | tar xJf - --wildcards --wildcards-match-slash -T tools/include.txt -X tools/exclude.txt @@ -24,4 +25,4 @@ mv "$name" src git rm --quiet --force -r tools git add src git commit --quiet --amend -m "Import $name" --date=now -git rebase --onto HEAD "$root" master +git rebase --onto HEAD "$root" "$branch" diff --git a/tools/include.txt b/tools/include.txt index e5b7793105..ec3c02e8e2 100644 --- a/tools/include.txt +++ b/tools/include.txt @@ -24,6 +24,9 @@ ^chrome/android/profiles/newest.txt ^chrome/app/theme/chromium/BRANDING ^chrome/build/*.txt +^components/cronet +^components/grpc_support +^components/prefs ^components/version_info ^crypto ^ipc/ipc_param_traits.h