aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authormduigou <none@none>2014-05-06 13:24:51 -0700
committermduigou <none@none>2014-05-06 13:24:51 -0700
commit57f149f37cfb109da37180f248b2259ca6f5eb6f (patch)
treed6ed8971c0856b628a9e9828ea8e0589a444c9d1 /common
parentad0cc7306f66e6b9e0eddc1de4a7454019b9565a (diff)
8042417: hgforest: allow local clone of extra repos
Reviewed-by: chegar, erikj
Diffstat (limited to 'common')
-rw-r--r--common/bin/hgforest.sh14
1 files changed, 13 insertions, 1 deletions
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?