8042417: hgforest: allow local clone of extra repos

Tue, 06 May 2014 13:24:51 -0700

author
mduigou
date
Tue, 06 May 2014 13:24:51 -0700
changeset 1145
3c596cad39e6
parent 1144
e16a393ee5e3
child 1146
406ecd8cce66

8042417: hgforest: allow local clone of extra repos
Reviewed-by: chegar, erikj

common/bin/hgforest.sh file | annotate | diff | comparison | revisions
     1.1 --- a/common/bin/hgforest.sh	Fri Apr 11 10:31:20 2014 -0700
     1.2 +++ b/common/bin/hgforest.sh	Tue May 06 13:24:51 2014 -0700
     1.3 @@ -144,8 +144,10 @@
     1.4        repos="${repos} ${i}"
     1.5      fi
     1.6    done
     1.7 +
     1.8 +  pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
     1.9 +
    1.10    if [ "${command_args}" != "" ] ; then
    1.11 -    pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
    1.12      if [ "x${pull_default}" = "x${pull_default_tail}" ] ; then
    1.13        echo "ERROR: Need initial clone from non-local source" > ${status_output}
    1.14        exit 1
    1.15 @@ -156,6 +158,16 @@
    1.16          repos_extra="${repos_extra} ${i}"
    1.17        fi
    1.18      done
    1.19 +  else
    1.20 +    if [ "x${pull_default}" = "x${pull_default_tail}" ] ; then
    1.21 +      # local source repo. Copy the extras ones that exist there.
    1.22 +      for i in ${subrepos_extra} ; do
    1.23 +        if [ -f ${pull_default}/${i}/.hg/hgrc -a ! -f ${i}/.hg/hgrc ] ; then
    1.24 +          # sub-repo there in source but not here
    1.25 +          repos_extra="${repos_extra} ${i}"
    1.26 +        fi
    1.27 +      done
    1.28 +    fi
    1.29    fi
    1.30    at_a_time=2
    1.31    # Any repos to deal with?

mercurial