From 30ab240f9de03d61df3b52f40ff85ce46973d89f Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Sun, 13 Mar 2016 04:25:42 +0100 Subject: [PATCH] Updated bzr2git.sh to use bzr-fastimport. --- bzr2git.sh | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/bzr2git.sh b/bzr2git.sh index 8f52621..0548850 100755 --- a/bzr2git.sh +++ b/bzr2git.sh @@ -1,28 +1,22 @@ #!/bin/bash PWD=`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" if [ ! -d ".bzr" ]; then echo "No .bzr directory here. Is this a BZR branch?" exit 1 fi -if [ -d "$GITDIR" ]; then - echo "$GITDIR already exists. Rename it and try again." +if [ -d ".git" ]; then + echo ".git already exists. Rename it and try again." exit 2 fi -echo "Creating bzr-git repo in $GITDIR" -mkdir "$GITDIR" -bzr init --format=git "$GITDIR" -echo "Pushing revisions to $GITDIR" -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 "Creating git repo in $DIRNAME" +git init +echo "Ex-/Importing repository..." +bzr fast-export | git fast-import echo "All done."