This is an automated email from the ASF dual-hosted git repository.
andor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 7074448f2 ZOOKEEPER-4806: Commits have to be refreshed after merging
7074448f2 is described below
commit 7074448f2ded4885d8940f71d5ae90f065e5fdeb
Author: szucsvillo <[email protected]>
AuthorDate: Thu Feb 15 14:40:32 2024 +0100
ZOOKEEPER-4806: Commits have to be refreshed after merging
Reviewers: anmolnar
Author: szucsvillo
Closes #2137 from szucsvillo/ZOOKEEPER-4806
---
zk-merge-pr.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/zk-merge-pr.py b/zk-merge-pr.py
index 932582b92..100244bfc 100755
--- a/zk-merge-pr.py
+++ b/zk-merge-pr.py
@@ -209,9 +209,21 @@ def cherry_pick(pr_num, merge_hash, default_branch):
pick_branch_name = "%s_PICK_PR_%s_%s" % (TEMP_BRANCH_PREFIX, pr_num,
pick_ref.upper())
- run_cmd("git fetch %s" % PUSH_REMOTE_NAME)
+ run_cmd("git fetch %s" % PR_REMOTE_NAME)
run_cmd("git checkout -b %s %s/%s" % (pick_branch_name, PUSH_REMOTE_NAME,
pick_ref))
+ current_attempt = 0
+ max_attempts = 6
+ # Check if the merge hash exists
+ while not run_cmd("git rev-parse --verify %s" % merge_hash):
+ if current_attempt >= max_attempts:
+ print("Error: The commit hash does not exist in the local
repository.")
+ exit()
+ current_attempt += 1
+ print("Waiting for the merge hash to become available...(10 sec)")
+ time.sleep(10)
+ run_cmd("git fetch %s" % PR_REMOTE_NAME)
+
try:
run_cmd("git cherry-pick -sx %s" % merge_hash)
except Exception as e: