Repository: spark-website Updated Branches: refs/heads/asf-site 0eaa78e8f -> ebbb1cc3e
Check if 'original_head' variable is defined in clean_up at merge script This is the same fix as https://github.com/apache/spark/pull/21349 Author: hyukjinkwon <[email protected]> Closes #114 from HyukjinKwon/fix-merge-script. Project: http://git-wip-us.apache.org/repos/asf/spark-website/repo Commit: http://git-wip-us.apache.org/repos/asf/spark-website/commit/ebbb1cc3 Tree: http://git-wip-us.apache.org/repos/asf/spark-website/tree/ebbb1cc3 Diff: http://git-wip-us.apache.org/repos/asf/spark-website/diff/ebbb1cc3 Branch: refs/heads/asf-site Commit: ebbb1cc3e012bf7551c9fbe0b7572da80b8d941a Parents: 0eaa78e Author: hyukjinkwon <[email protected]> Authored: Mon Jun 11 13:44:45 2018 -0700 Committer: Marcelo Vanzin <[email protected]> Committed: Mon Jun 11 13:44:45 2018 -0700 ---------------------------------------------------------------------- merge_pr.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark-website/blob/ebbb1cc3/merge_pr.py ---------------------------------------------------------------------- diff --git a/merge_pr.py b/merge_pr.py index dc289b3..6644603 100755 --- a/merge_pr.py +++ b/merge_pr.py @@ -85,15 +85,15 @@ def continue_maybe(prompt): fail("Okay, exiting") def clean_up(): - print "Restoring head pointer to %s" % original_head - run_cmd("git checkout %s" % original_head) + if 'original_head' in globals(): + print "Restoring head pointer to %s" % original_head + run_cmd("git checkout %s" % original_head) - branches = run_cmd("git branch").replace(" ", "").split("\n") - - for branch in filter(lambda x: x.startswith(BRANCH_PREFIX), branches): - print "Deleting local branch %s" % branch - run_cmd("git branch -D %s" % branch) + branches = run_cmd("git branch").replace(" ", "").split("\n") + for branch in filter(lambda x: x.startswith(BRANCH_PREFIX), branches): + print "Deleting local branch %s" % branch + run_cmd("git branch -D %s" % branch) # merge the requested PR and return the merge hash def merge_pr(pr_num, target_ref, title, body, pr_repo_desc): --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
