Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 47 lines (35 sloc) 938 Bytes
#!/bin/bash
#
# Usage: git-push-to-try [-t|--tip] [-r REVS|--rev REVS] HG_REPO TRY_PARAMS
set -e
PATH=$(dirname $0):$PATH
# Sigh, command-line parsing in bash is so much fun.
while true; do
if [[ "$1" == "-t" || "$1" == "--tip" ]]; then
tip_cmd="--tip"
shift
continue
fi
if [[ "$1" == "-r" || "$1" == "--rev" ]]; then
revs="$2"
shift
shift
continue
fi
break
done
hg_repo=$1
if [[ -n "$hg_repo" ]]; then
shift
fi
if [[ -z "$hg_repo" || -z "$@" ]]; then
echo "usage: $(basename "$0") [-t|--tip] [-r REVS|--rev REVS] HG_REPO TRY_PARAMS"
exit 255
fi
git-push-to-hg $tip_cmd "$hg_repo" "$revs"
hg -R "$hg_repo" -q qnew try -m "try: $*" > /dev/null
echo "try: $@"
hg -R "$hg_repo" push -f -r tip ssh://hg.mozilla.org/try
echo
echo "https://treeherder.mozilla.org/#/jobs?repo=try&revision=$(hg -R "$hg_repo" log -l1 --template "{node|short}")"
hg -R "$hg_repo" -q qpop -a > /dev/null