Updated bzr2git.sh to use bzr-fastimport.

This commit is contained in:
Markus Birth 2016-03-13 04:25:42 +01:00
parent ef9bcde795
commit 30ab240f9d

View File

@ -1,28 +1,22 @@
#!/bin/bash #!/bin/bash
PWD=`pwd` PWD=`pwd`
DIRNAME=`basename "$PWD"` DIRNAME=`basename "$PWD"`
GITDIR="../$DIRNAME.GIT" if [ ! -d "$HOME/.bazaar/plugins/fastimport" ]; then
echo "Fastimport plugin not found. Installing..."
bzr branch lp:bzr-fastimport ~/.bazaar/plugins/fastimport
fi
echo "Processing: $DIRNAME" echo "Processing: $DIRNAME"
if [ ! -d ".bzr" ]; then if [ ! -d ".bzr" ]; then
echo "No .bzr directory here. Is this a BZR branch?" echo "No .bzr directory here. Is this a BZR branch?"
exit 1 exit 1
fi fi
if [ -d "$GITDIR" ]; then if [ -d ".git" ]; then
echo "$GITDIR already exists. Rename it and try again." echo ".git already exists. Rename it and try again."
exit 2 exit 2
fi fi
echo "Creating bzr-git repo in $GITDIR" echo "Creating git repo in $DIRNAME"
mkdir "$GITDIR" git init
bzr init --format=git "$GITDIR" echo "Ex-/Importing repository..."
echo "Pushing revisions to $GITDIR" bzr fast-export | git fast-import
bzr dpush "$GITDIR"
echo "cd'ing"
cd "$GITDIR"
echo "Fixing branch"
git branch master
git checkout master
echo "Resetting branch"
git reset --hard HEAD
echo "cd'ing back"
cd -
echo "All done." echo "All done."