@@ -23,14 +23,16 @@ set -o errexit
2323set -o nounset
2424set -o pipefail
2525
26- declare -r KUBE_ROOT =" $( dirname " ${BASH_SOURCE} " ) /.. "
27- cd " ${KUBE_ROOT } "
26+ declare -r REPO_ROOT =" $( git rev-parse --show-toplevel ) "
27+ cd " ${REPO_ROOT } "
2828
2929declare -r STARTINGBRANCH=$( git symbolic-ref --short HEAD)
30- declare -r REBASEMAGIC=" ${KUBE_ROOT } /.git/rebase-apply"
30+ declare -r REBASEMAGIC=" ${REPO_ROOT } /.git/rebase-apply"
3131DRY_RUN=${DRY_RUN:- " " }
3232UPSTREAM_REMOTE=${UPSTREAM_REMOTE:- upstream}
3333FORK_REMOTE=${FORK_REMOTE:- origin}
34+ MAIN_REPO_NAME=${MAIN_REPO_NAME:- " client-python" }
35+ MAIN_REPO_ORG=${MAIN_REPO_ORG:- " kubernetes-incubator" }
3436
3537if [[ -z ${GITHUB_USER:- } ]]; then
3638 echo " Please export GITHUB_USER=<your-user> (or GH organization, if that's where your fork lives)"
@@ -135,7 +137,7 @@ Cherry pick of ${PULLSUBJ} on ${rel}.
135137$( printf ' %s\n' " ${SUBJECTS[@]} " )
136138EOF
137139
138- hub pull-request -F " ${prtext} " -h " ${GITHUB_USER} :${NEWBRANCH} " -b " kubernetes :${rel} "
140+ hub pull-request -F " ${prtext} " -h " ${GITHUB_USER} :${NEWBRANCH} " -b " ${MAIN_REPO_ORG} :${rel} "
139141}
140142
141143git checkout -b " ${NEWBRANCHUNIQ} " " ${BRANCH} "
@@ -144,7 +146,8 @@ cleanbranch="${NEWBRANCHUNIQ}"
144146gitamcleanup=true
145147for pull in " ${PULLS[@]} " ; do
146148 echo " +++ Downloading patch to /tmp/${pull} .patch (in case you need to do this again)"
147- curl -o " /tmp/${pull} .patch" -sSL " http://pr.k8s.io/${pull} .patch"
149+
150+ curl -o " /tmp/${pull} .patch" -sSL " https://github.com/${MAIN_REPO_ORG} /${MAIN_REPO_NAME} /pull/${pull} .patch"
148151 echo
149152 echo " +++ About to attempt cherry pick of PR. To reattempt:"
150153 echo " $ git am -3 /tmp/${pull} .patch"
@@ -195,8 +198,8 @@ if [[ -n "${DRY_RUN}" ]]; then
195198 exit 0
196199fi
197200
198- if git remote -v | grep ^${FORK_REMOTE} | grep kubernetes/kubernetes .git; then
199- echo " !!! You have ${FORK_REMOTE} configured as your kubernetes/kubernetes .git"
201+ if git remote -v | grep ^${FORK_REMOTE} | grep { $MAIN_REPO_ORG }/{ $MAIN_REPO_NAME } .git; then
202+ echo " !!! You have ${FORK_REMOTE} configured as your { $MAIN_REPO_ORG }/{ $MAIN_REPO_NAME } .git"
200203 echo " This isn't normal. Leaving you with push instructions:"
201204 echo
202205 echo " +++ First manually push the branch this script created:"
0 commit comments