From cd5b3d4c353f850e4226a2eedd9474d21e25bfd1 Mon Sep 17 00:00:00 2001 From: mduigou Date: Tue, 6 May 2014 13:24:51 -0700 Subject: [PATCH] 8042417: hgforest: allow local clone of extra repos Reviewed-by: chegar, erikj --- common/bin/hgforest.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/bin/hgforest.sh b/common/bin/hgforest.sh index 4a5f0b7..234bc69 100644 --- a/common/bin/hgforest.sh +++ b/common/bin/hgforest.sh @@ -144,8 +144,10 @@ if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone repos="${repos} ${i}" fi done + + pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'` + if [ "${command_args}" != "" ] ; then - pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'` if [ "x${pull_default}" = "x${pull_default_tail}" ] ; then echo "ERROR: Need initial clone from non-local source" > ${status_output} exit 1 @@ -156,6 +158,16 @@ if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone repos_extra="${repos_extra} ${i}" fi done + else + if [ "x${pull_default}" = "x${pull_default_tail}" ] ; then + # local source repo. Copy the extras ones that exist there. + for i in ${subrepos_extra} ; do + if [ -f ${pull_default}/${i}/.hg/hgrc -a ! -f ${i}/.hg/hgrc ] ; then + # sub-repo there in source but not here + repos_extra="${repos_extra} ${i}" + fi + done + fi fi at_a_time=2 # Any repos to deal with? -- GitLab