Source

scons-migration-scripts / convert.sh

#!/bin/bash

# Run the conversion

CURDIR="$( cd "$( dirname "$0" )" && pwd )"
PARENT="$( cd "$( dirname "$0" )/.." && pwd )"
REPO_PATH=file://$PARENT/scons-mirror
DEST_DIR=$PARENT/scons-full
DEST_NO_BRANCH_CLONE=$PARENT/scons-nobranches
DEST_SELECTED=$PARENT/scons-selected-no-core
BRANCHES="2.0 automake_model comments fortran_refactor heapmonitor i18n installer jython libwithcontext msvc_fixes py-builder sigrefactor vs_revamp"

# NOTE: `packaging` branch is missing from the full repository for some reason

if [ -x $DEST_DIR ]
then
    echo "Destination folder $DEST_DIR already exists."
    exit 1
fi


mkdir $DEST_DIR

hg convert --datesort --authormap=$CURDIR/authors.txt --filemap=$CURDIR/filemap.txt --splicemap=$CURDIR/splicemap.txt $REPO_PATH $DEST_DIR


# Create additional clone without branches (trunk/ only)
rm -rf $DEST_NO_BRANCH_CLONE
echo "Creating branchless clone in $DEST_NO_BRANCH_CLONE"
hg clone $DEST_DIR $DEST_NO_BRANCH_CLONE -r default -U

# Create additioinal clone with selected branches
rm -rf $DEST_SELECTED
echo "Creating clone with selected branches in $DEST_SELECTED"
hg clone $DEST_DIR $DEST_SELECTED -r default -U
for branch in $BRANCHES
do
  hg pull --cwd $DEST_SELECTED -b $branch $DEST_DIR
done


# add hgignore
#cd $DEST_DIR
#hg up -C default
#cp ../hgignore.tmpl .hgignore
#hg add .hgignore
#hg commit -m "Add .hgignore."