]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-backport.sh: allow cherry-picking from non-master (via --force)
authorNathan Cutler <ncutler@suse.com>
Wed, 6 Nov 2019 13:29:28 +0000 (14:29 +0100)
committerNathan Cutler <ncutler@suse.com>
Fri, 8 Nov 2019 07:20:04 +0000 (08:20 +0100)
Signed-off-by: Nathan Cutler <ncutler@suse.com>
src/script/ceph-backport.sh

index b8930929a1917bb179f26b90594310d579f4ce7f..1fc2915a4c6fead1d00d5376339421924358dbaa 100755 (executable)
@@ -217,10 +217,15 @@ function cherry_pick_phase {
     if [ "$base_branch" = "ceph:master" ] ; then
         true
     else
-        error "${original_pr_url} is targeting ${base_branch}: cowardly refusing to perform automated cherry-pick"
-        info "Out of an abundance of caution, the script only automates cherry-picking of commits from PRs targeting \"ceph:master\"."
-        info "You can still use the script to stage the backport, though. Just prepare the local branch \"${local_branch}\" manually and re-run the script."
-        false
+        if [ "$FORCE" ] ; then
+            warning "base_branch ->$base_branch<- is something other than \"ceph:master\""
+            info "--force was given, so continuing anyway"
+        else
+            error "${original_pr_url} is targeting ${base_branch}: cowardly refusing to perform automated cherry-pick"
+            info "Out of an abundance of caution, the script only automates cherry-picking of commits from PRs targeting \"ceph:master\"."
+            info "You can still use the script to stage the backport, though. Just prepare the local branch \"${local_branch}\" manually and re-run the script."
+            false
+        fi
     fi
     merged=$(echo "${remote_api_output}" | jq -r '.merged')
     if [ "$merged" = "true" ] ; then