mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-13 03:12:21 +01:00
handle error cases in bb_repo_upload
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
This commit is contained in:
parent
1611be25ff
commit
77d6dc43a8
1 changed files with 20 additions and 7 deletions
|
|
@ -74,11 +74,22 @@ function bb_repo_upload()
|
||||||
local REVIEWERS
|
local REVIEWERS
|
||||||
local A
|
local A
|
||||||
|
|
||||||
|
GROUP_NAME="reviewers-buildbot"
|
||||||
|
|
||||||
declare -a REVIEWERS
|
declare -a REVIEWERS
|
||||||
REVIEWERS=$(txw --quiet gerrit-getGroupMembers reviewers-buildbot 2> /dev/null | tr " " ",")
|
REVIEWERS=$(txw --quiet gerrit-getGroupMembers $GROUP_NAME 2> /dev/null | tr " " ",")
|
||||||
echo "Reviewers: $REVIEWERS"
|
if [[ -z $REVIEWERS ]]; then
|
||||||
echo "Cmd: repo upload --cbr --re=$REVIEWERS ."
|
echo "Error when executing 'txw gerrit-getGroupMembers $GROUP_NAME'."
|
||||||
yes | repo upload --cbr --re=$REVIEWERS .
|
echo "Uploading without setting reviewers !"
|
||||||
|
yes | repo upload --cbr .
|
||||||
|
else
|
||||||
|
echo "Uploading with the following reviewers: $REVIEWERS"
|
||||||
|
# echo "Cmd: repo upload --cbr --re=$REVIEWERS ."
|
||||||
|
yes | repo upload --cbr --re=$REVIEWERS .
|
||||||
|
if [[ $? == 2 ]]; then
|
||||||
|
echo "Repo upload failed. Nothing to upload?"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function bb_merge_bottom_branch_to_here()
|
function bb_merge_bottom_branch_to_here()
|
||||||
|
|
@ -109,6 +120,7 @@ function bb_push_with_care()
|
||||||
{
|
{
|
||||||
local branch
|
local branch
|
||||||
local project
|
local project
|
||||||
|
local cmd
|
||||||
|
|
||||||
branch=$(git branch -a | grep "remotes/m/" | cut -d'/' -f5 | cut -d' ' -f1)
|
branch=$(git branch -a | grep "remotes/m/" | cut -d'/' -f5 | cut -d' ' -f1)
|
||||||
project=$(git remote -v | grep umg | tail -n 1 | cut -d'/' -f6 | cut -d' ' -f1)
|
project=$(git remote -v | grep umg | tail -n 1 | cut -d'/' -f6 | cut -d' ' -f1)
|
||||||
|
|
@ -119,14 +131,15 @@ function bb_push_with_care()
|
||||||
fi
|
fi
|
||||||
echo "Pushing branch '$branch' on project '$project'"
|
echo "Pushing branch '$branch' on project '$project'"
|
||||||
echo "Press Enter to continue"
|
echo "Press Enter to continue"
|
||||||
echo "Command: git push ssh://android.intel.com/a/buildbot/$project HEAD:refs/heads/platform/buildbot/$branch"
|
cmd='git push ssh://android.intel.com/a/buildbot/$project HEAD:refs/heads/platform/buildbot/$branch'
|
||||||
|
echo "Command: $cmd"
|
||||||
read
|
read
|
||||||
git push ssh://android.intel.com/a/buildbot/$project HEAD:refs/heads/platform/buildbot/$branch
|
eval $cmd
|
||||||
|
|
||||||
echo "Refreshing repo"
|
echo "Refreshing repo"
|
||||||
echo "Waitin 30s..."
|
echo "Waitin 30s..."
|
||||||
sleep "30"
|
sleep "30"
|
||||||
repo sync .
|
repo sync -j5 .
|
||||||
|
|
||||||
echo "Display merged tree:"
|
echo "Display merged tree:"
|
||||||
git log --pretty=oneline --graph -3 | cat
|
git log --pretty=oneline --graph -3 | cat
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue