Created
June 27, 2015 21:37
-
-
Save yuki-takei/b91e4da0219429ec99b3 to your computer and use it in GitHub Desktop.
devide Marcurial repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TMPDIR=/tmp | |
# check args | |
if [ $# != 2 ]; then | |
echo "usage: $0 SRCREPOS DESTDIR" 1>&2 | |
exit 0 | |
fi | |
SRCREPOS=$1 | |
DESTDIR=$2 | |
# make DESTDIR if not exists | |
if [ ! -d $DESTDIR ] | |
then | |
mkdir $DESTDIR; | |
fi | |
DESTDIR_FULL=`pwd`/$DESTDIR | |
cd $SRCREPOS | |
# main loop | |
for subdir in *; | |
do | |
FILEMAP=$TMPDIR/$subdir.filemap | |
# generate filemap | |
echo include $subdir > $FILEMAP; | |
echo rename $subdir . >> $FILEMAP; | |
# convert | |
hg convert --filemap=$FILEMAP . $DESTDIR_FULL/$subdir; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment