@@ -23,14 +23,16 @@ set -o errexit
23
23
set -o nounset
24
24
set -o pipefail
25
25
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 } "
28
28
29
29
declare -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"
31
31
DRY_RUN=${DRY_RUN:- " " }
32
32
UPSTREAM_REMOTE=${UPSTREAM_REMOTE:- upstream}
33
33
FORK_REMOTE=${FORK_REMOTE:- origin}
34
+ MAIN_REPO_NAME=${MAIN_REPO_NAME:- " client-python" }
35
+ MAIN_REPO_ORG=${MAIN_REPO_ORG:- " kubernetes-incubator" }
34
36
35
37
if [[ -z ${GITHUB_USER:- } ]]; then
36
38
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}.
135
137
$( printf ' %s\n' " ${SUBJECTS[@]} " )
136
138
EOF
137
139
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} "
139
141
}
140
142
141
143
git checkout -b " ${NEWBRANCHUNIQ} " " ${BRANCH} "
@@ -144,7 +146,8 @@ cleanbranch="${NEWBRANCHUNIQ}"
144
146
gitamcleanup=true
145
147
for pull in " ${PULLS[@]} " ; do
146
148
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"
148
151
echo
149
152
echo " +++ About to attempt cherry pick of PR. To reattempt:"
150
153
echo " $ git am -3 /tmp/${pull} .patch"
@@ -195,8 +198,8 @@ if [[ -n "${DRY_RUN}" ]]; then
195
198
exit 0
196
199
fi
197
200
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"
200
203
echo " This isn't normal. Leaving you with push instructions:"
201
204
echo
202
205
echo " +++ First manually push the branch this script created:"
0 commit comments