X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=scripts%2Fgit-hg-sub-import;h=a535772e858a803b521f6a2c3e807940fdcb8598;hb=73194482c7c58af7f010cfb8eaf85355d7c4b867;hp=4baf1bcb5bd4b848d29c5be9e191ed7b2a288b17;hpb=d08b48276481596a71c4451b3667cd1de9abc3f7;p=hvutilities.git diff --git a/scripts/git-hg-sub-import b/scripts/git-hg-sub-import index 4baf1bc..a535772 100755 --- a/scripts/git-hg-sub-import +++ b/scripts/git-hg-sub-import @@ -31,13 +31,10 @@ hg_parse_projrc() { fi # Repo name can have spaces in it, hence the use of ${*} - local repo_orig="${*}" local repo="${*}" - # Quote spaces - repo=${repo// /\\\\ } - if [ -f "${repo}/.hg/projrc" ]; then + TMPF="/tmp/$(basename $0).projrc-$$.tmp" # Create temporary copy to replace backslashes with slashes. @@ -130,41 +127,6 @@ apply_substitutions() { echo "${path}" } -# git-remote-hg doesn't work with Mercurial projrc extension, -# so use it manually. -# We parse the projrc file in the assembly (on the server), to check -# for any projrc substitutions. -# -# Arg 1: subproject (path and name) -# -# Return the new substitution name if found, and original subrepo name if not -# (with the path stripped) -hg_check_projrc_config() { - if [ ${#} -lt 1 ]; then - echo "Missing subrepos name" - fi - - # Repo name can have spaces in it, hence the use of ${*} - local subrepo_orig="${*}" - local subrepo="${*}" - - # Quote spaces - subrepo=${subrepo// /\\\\ } - - asm=$(cat .git/config | grep "hg::" | sed "s/.*url = hg::\(.*\)/\1/") - - local baserepo=$(basename "${subrepo}") - - if cat "${asm}/.hg/projrc" | grep -q "${baserepo}" ; then - projrc=$(cat "${asm}/.hg/projrc" | grep "${baserepo}" | sed "s/.*= \(.*\)/\1/") - else - # No substitution, return same name as original - projrc=$(basename "${subrepo_orig}") - fi - - echo "${projrc}" -} - # Map a revision to a branch name in HG subrepository # Use hg log (in original repo) to get branch name corresponding to that # revision.