-# Map a revision to a branch name in HG subrepository
-# Use hg log (in original repo) to get branch name corresponding to that
-# revision.
-#
-# Arg 1: subrepository URL
-# Arg 2: id
-# Arg 3: revision
-subrepo_find_branch() {
- local src="${1}"
- local id="${2}"
- local rev="${3}"
-
- pushd "${LSI_SRV}/${src}"
-
- branch=$(hg log -r ${rev} | grep "branch:" | sed "s/branch:\ *//")
-
- if [ -z "${branch}" ]; then
- # If "branch:" is null, this indicate we are on the default branch
- branch=default
- fi
-
- if [ -n "${debug}" ]; then
- echo " branch: ${branch}"
- fi
-
- popd
-}
-