Commit 53cc58c2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gitask: add -m support for approve command

parent bb54204e
...@@ -38,6 +38,7 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then ...@@ -38,6 +38,7 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo " show NNNN - show subtask list for task NNNN" echo " show NNNN - show subtask list for task NNNN"
echo " quota - show quota on the remote servers" echo " quota - show quota on the remote servers"
echo " cancel NNNN - cancel task NNNN" echo " cancel NNNN - cancel task NNNN"
echo " approve NNNN SUBTASK [-m <message>] - approve subtask"
echo " acl [branch] show package - show acl for the package" echo " acl [branch] show package - show acl for the package"
echo " acl [branch] package add|del <maintainer> - add/del acl for the package" echo " acl [branch] package add|del <maintainer> - add/del acl for the package"
echo " rebuild --help - rebuild package" echo " rebuild --help - rebuild package"
...@@ -169,6 +170,7 @@ if [ "$1" = "log" ] ; then ...@@ -169,6 +170,7 @@ if [ "$1" = "log" ] ; then
fi fi
if [ "$1" = "quota" ] ; then if [ "$1" = "quota" ] ; then
shift
docmd ssh $GIRARHOST quota "$@" docmd ssh $GIRARHOST quota "$@"
docmd ssh $GEARHOST quota "$@" docmd ssh $GEARHOST quota "$@"
exit exit
...@@ -203,7 +205,7 @@ if [ "$1" = "ls" ] ; then ...@@ -203,7 +205,7 @@ if [ "$1" = "ls" ] ; then
fi fi
if [ "$1" = "-w" ] ; then if [ "$1" = "-w" ] ; then
WN="$2" WN="$2"
[ -n "$WN" ] && WN=10 [ -z "$WN" ] && WN=10
watch -c -n $WN $0 ls watch -c -n $WN $0 ls
exit exit
fi fi
...@@ -332,7 +334,6 @@ fi ...@@ -332,7 +334,6 @@ fi
if [ "$1" = "show" ] ; then if [ "$1" = "show" ] ; then
shift shift
COMMIT=''
TASK="$(get_task_number "$1")" TASK="$(get_task_number "$1")"
if [ -z "$TASK" ] ; then if [ -z "$TASK" ] ; then
TASK="$(get_last)" || fatal "Can't get last task" TASK="$(get_last)" || fatal "Can't get last task"
...@@ -381,6 +382,7 @@ fi ...@@ -381,6 +382,7 @@ fi
if [ "$1" = "cancel" ] ; then if [ "$1" = "cancel" ] ; then
shift shift
TASK="$(get_task_number $1)" TASK="$(get_task_number $1)"
[ -n "$TASK" ] || fatal "No task number"
if [ "$GEARHOST" = "git.eter" ] || [ "$GEARHOST" = "git.office" ] ; then if [ "$GEARHOST" = "git.eter" ] || [ "$GEARHOST" = "git.office" ] ; then
docmd ssh $GEARHOST task cancel "$TASK" docmd ssh $GEARHOST task cancel "$TASK"
else else
...@@ -389,6 +391,36 @@ if [ "$1" = "cancel" ] ; then ...@@ -389,6 +391,36 @@ if [ "$1" = "cancel" ] ; then
exit exit
fi fi
if [ "$1" = "approve" ] ; then
shift
TASK=''
SUBTASK=''
MESSAGETEXT=''
while [ -n "$1" ] ; do
if [ "$1" = "-m" ] ; then
MESSAGETEXT="$2"
shift
elif echo "$1" | grep -qv "^-" ; then
if [ -z "$TASK" ] ; then
TASK="$(get_task_number $1)"
else
SUBTASK="$1"
fi
else
fatal "Unknown param $1"
fi
shift
done
[ -n "$TASK" ] || TASK="$(get_last)" || fatal "Can't get last task"
[ -n "$SUBTASK" ] || fatal "Subtask number required"
showcmd ssh $GEARHOST task approve "$TASK" "$SUBTASK"
echo "$MESSAGETEXT" | ssh $GEARHOST task approve "$TASK" "$SUBTASK"
exit
fi
if [ "$1" = "share" ] && [ -n "$2" ] ; then if [ "$1" = "share" ] && [ -n "$2" ] ; then
shift shift
TASK="$(get_task_number $1)" TASK="$(get_task_number $1)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment