Merge "Add --dry-run mode to code review abandon tool"

This commit is contained in:
Jenkins 2016-01-15 08:23:56 +00:00 committed by Gerrit Code Review
commit 2c599814fb
1 changed files with 13 additions and 2 deletions

View File

@ -28,15 +28,26 @@
# first purge the all reviews that are more than 4w old and blocked by a core -2
if [ "$1" = "--dry-run" ]; then
echo "Enabling dry run mode"
DRY_RUN=1
else
DRY_RUN=0
fi
set -o errexit
function abandon_review {
local gitid=$1
shift
local msg=$@
echo "Abandoning $gitid"
# echo ssh review.openstack.org gerrit review $gitid --abandon --message \"$msg\"
ssh review.openstack.org gerrit review $gitid --abandon --message \"$msg\"
if [ $DRY_RUN -eq 1 ]; then
echo "Would abandon $gitid"
else
echo "Abandoning $gitid"
ssh review.openstack.org gerrit review $gitid --abandon --message \"$msg\"
fi
}
PROJECTS="(project:openstack/neutron OR project:openstack/neutron-fwaas OR \