提交 20f3a66e 编写于 作者: M mduigou

8038435: Some hgforest.sh commands don't receive parameters

Reviewed-by: katleman
上级 50fbc64d
#!/bin/bash #!/bin/sh
# #
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
...@@ -60,10 +60,10 @@ done ...@@ -60,10 +60,10 @@ done
command="$1"; shift command="$1"; shift
repo_base="$@" command_args="$@"
usage() { usage() {
echo "usage: $0 [-q|--quiet] [-v|--verbose] [--] <command> [repo_base_path]" > ${status_output} echo "usage: $0 [-q|--quiet] [-v|--verbose] [--] <command> [commands...]" > ${status_output}
exit 1 exit 1
} }
...@@ -113,26 +113,30 @@ subrepos_extra="closed jdk/src/closed jdk/make/closed jdk/test/closed hotspot/ma ...@@ -113,26 +113,30 @@ subrepos_extra="closed jdk/src/closed jdk/make/closed jdk/test/closed hotspot/ma
pull_default="" pull_default=""
repos="" repos=""
repos_extra="" repos_extra=""
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone" ] ; then
if [ -f .hg/hgrc ] ; then if [ ! -f .hg/hgrc ] ; then
pull_default=`hg paths default` echo "ERROR: Need initial repository to use this script" > ${status_output}
if [ "${pull_default}" = "" ] ; then exit 1
echo "ERROR: Need initial clone with 'hg paths default' defined" > ${status_output}
exit 1
fi
fi fi
pull_default=`hg paths default`
if [ "${pull_default}" = "" ] ; then if [ "${pull_default}" = "" ] ; then
echo "ERROR: Need initial repository to use this script" > ${status_output} echo "ERROR: Need initial clone with 'hg paths default' defined" > ${status_output}
exit 1 exit 1
fi fi
for i in ${subrepos} ; do for i in ${subrepos} ; do
if [ ! -f ${i}/.hg/hgrc ] ; then if [ ! -f ${i}/.hg/hgrc ] ; then
repos="${repos} ${i}" repos="${repos} ${i}"
fi fi
done done
if [ "${repo_base}" != "" ] ; then if [ "${command_args}" != "" ] ; then
pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'` pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
pull_extra="${repo_base}/${pull_default_tail}" if [ "x${pull_default}" = "x${pull_default_tail}" ] ; then
echo "ERROR: Need initial clone from non-local source" > ${status_output}
exit 1
fi
pull_extra="${command_args}/${pull_default_tail}"
for i in ${subrepos_extra} ; do for i in ${subrepos_extra} ; do
if [ ! -f ${i}/.hg/hgrc ] ; then if [ ! -f ${i}/.hg/hgrc ] ; then
repos_extra="${repos_extra} ${i}" repos_extra="${repos_extra} ${i}"
...@@ -214,9 +218,8 @@ else ...@@ -214,9 +218,8 @@ else
done done
( (
( (
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone" ] ; then
pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`" pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
echo "hg clone ${pull_newrepo} ${i}" > ${status_output}
path="`dirname ${i}`" path="`dirname ${i}`"
if [ "${path}" != "." ] ; then if [ "${path}" != "." ] ; then
times=0 times=0
...@@ -229,10 +232,11 @@ else ...@@ -229,10 +232,11 @@ else
sleep 5 sleep 5
done done
fi fi
echo "hg clone ${pull_newrepo} ${i}" > ${status_output}
(PYTHONUNBUFFERED=true hg${global_opts} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 & (PYTHONUNBUFFERED=true hg${global_opts} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
else else
echo "cd ${i} && hg${global_opts} ${command} ${repo_base}" > ${status_output} echo "cd ${i} && hg${global_opts} ${command} ${command_args}" > ${status_output}
cd ${i} && (PYTHONUNBUFFERED=true hg${global_opts} ${command} ${command_repo}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 & cd ${i} && (PYTHONUNBUFFERED=true hg${global_opts} ${command} ${command_args}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
fi fi
echo $! > ${tmp}/${repopidfile}.pid echo $! > ${tmp}/${repopidfile}.pid
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册