diff --git a/maintenance/code-backports.sh b/maintenance/code-backports.sh index c1d90c7..b72d347 100755 --- a/maintenance/code-backports.sh +++ b/maintenance/code-backports.sh @@ -49,7 +49,7 @@ git checkout $beQuiet v$version-next-backports 2>/dev/null && git fetch $beQuiet --all && git pull $beQuiet origin v$version-next-backports && git rebase origin/v$version 2>/dev/null && - git push -u origin v$version-next-backports|| abortAndExit rebase + git push -u origin +v$version-next-backports || abortAndExit rebase # Find backports to attempt: prlist=`gh pr list -L 1 --repo squid-cache/squid --state closed --label backport-to-v$version | wc -l` @@ -57,9 +57,13 @@ if test "$prlist" -ne 0; then gh pr list --repo squid-cache/squid --state closed --label backport-to-v$version | while read prnum text; do # find a commit in $srcbranch with " (#$prnum)" subject suffix git log --oneline github/$srcbranch --grep=" (#$prnum)\$" | while read sha rest; do - msg=`git cherry-pick $sha || abortAndContinue cherry-pick` - if ! test -z $msg ; then + msg=`git cherry-pick $beQuiet $sha 2>&1 || abortAndContinue cherry-pick` + if ! test -z "$msg" ; then echo $msg | grep -E "^error:" + if `echo $msg | grep "The previous cherry-pick is now empty"`; then + gh pr edit $prnum --remove-label backport-to-v$version + gh pr comment $prnum --body "queued for backport to v$version" + fi fi gitCleanWorkspace done