#!/bin/sh

cat >> $HGRCPATH <<EOF
[web]
push_ssl = false
allow_push = *
[ui]
logtemplate ="{node|short} ({phase}): {desc}\n"
[phases]
publish=False
[extensions]
hgext.rebase=
EOF
echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH

mkcommit() {
   echo "$1" > "$1"
   hg add "$1"
   hg ci -m "$1"
}
getid() {
   hg id --hidden --debug -ir "$1"
}

setuprepos() {
    echo creating test repo for test case $1
    mkdir $1
    cd $1
    echo - pulldest
    hg init pushdest
    cd pushdest
    mkcommit O
    hg phase --public .
    cd ..
    echo - main
    hg clone -q pushdest main
    echo - pushdest
    hg clone -q main pulldest
    echo 'cd into `main` and proceed with env setup'
}
