diff options
author | Leif Lindholm <leif.lindholm@linaro.org> | 2014-10-03 12:32:58 +0100 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2014-10-03 12:32:58 +0100 |
commit | 692497505f95a5c20365f7b0e0ff186506073234 (patch) | |
tree | 07a1b5e5d83fdbcb4e34421aa070066dc2bf147a | |
parent | af0ba4f4190881e66c26ffc5c88463fb28d1ca0d (diff) |
Add some fault-resilience to merge-topic-branches
Previously, mergeall.sh would bail out at first failure. Now it will abort
the current merge operation, progress with remaining topic branches, and
print a summary of branches to be manually merged at the end.
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
-rw-r--r-- | common-functions | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/common-functions b/common-functions index b592fb7..1598926 100644 --- a/common-functions +++ b/common-functions @@ -140,10 +140,32 @@ fetch_linaro() merge_topic_branches() { - list_local_topic_branches | while read topic; do + FAILURES="" + for topic in `list_topic_branches`; do echo merging topic: $topic - git merge --no-edit $topic || die "merge error $topic" + git merge --no-edit $topic + if [ $? -ne 0 ]; then + FAILURES="`printf \"%s\n%s\n\" \"$topic\" \"$FAILURES\"`" + git merge --abort + fi done + + if [ X"$FAILURES" != X"" ]; then + echo "The following branches failed to merge:" + echo "============================================================" + echo "$FAILURES" | while read topic; do + echo "$topic" + done + echo "============================================================" + echo "They can be manually merged with git merge --no-edit <topic>" + echo "and manually committed once conflicts have been resolved." + echo "============================================================" + return 1 + else + echo "===============================" + echo "All topics merged successfully." + echo "===============================" + fi } rebase_topic_branches() |