Code review comment for lp:~termie/bzr-fastimport/marks_normalization

Revision history for this message
termie (termie) wrote :

It is not quite that simple, as there are 4 distinct bugs being resolved here that don't all get triggered through the same code paths. Anyway, it fails on pretty much any trivial import from git (i don't see any tests actually testing the functionality of the code anywhere :/), here is a shell script that demonstrates the failure. Also probably requires bzr-2.2 because there is a bug in bzr-2.3 that will produce an exception unrelated to the bug in bzr-fastimport.

#!/bin/bash

TESTDIR=/tmp/git-bzr-test
BZRBRANCHNAME=bzrtest
BZRBRANCH=$TESTDIR/$BZRBRANCHNAME

if [ -d "$TESTDIR" ];
then
  rm -rf $TESTDIR
fi

mkdir $TESTDIR
cd $TESTDIR

# Make a bzr branch to interact with
bzr init $BZRBRANCH
cd $BZRBRANCH
echo "touch" > touch.txt
bzr add touch.txt
bzr commit -m "touch test"
echo "touch2" > touch2.txt
bzr add touch2.txt
bzr commit -m "touch2 test"

# Make the git repo and import the bzr repo
git init ${BZRBRANCH}_git
cd ${BZRBRANCH}_git
mkdir -p ${BZRBRANCH}_git/.git/bzr/map
bzr init-repo --no-trees ${BZRBRANCH}_git/.git/bzr/repo
bzr branch ${BZRBRANCH} ${BZRBRANCH}_git/.git/bzr/repo/master
bzr fast-export --plain \
                --export-marks=${BZRBRANCH}_git/.git/bzr/map/master-bzr \
                --git-branch=bzr/master ${BZRBRANCH}_git/.git/bzr/repo/master | \
  git fast-import --quiet --export-marks=${BZRBRANCH}_git/.git/bzr/map/master-git

# -- captured output (bzr fast-export) --
#commit refs/heads/bzr/master
#mark :1
#committer termie <email address hidden> 1296532203 -0800
#data 10
#touch test
#M 644 inline touch.txt
#data 6
#touch

#commit refs/heads/bzr/master
#mark :2
#committer termie <email address hidden> 1296532203 -0800
#data 11
#touch2 test
#from :1
#M 644 inline touch2.txt
#data 7
#touch2

# -- .git/bzr/map/master-bzr --
#:1 <email address hidden>
#:2 <email address hidden>

git branch master bzr/master
git checkout master

# Make some changes and push them back
git checkout -b pushed
echo 'touch3' > touch2.txt
git add touch2.txt
git commit -m 'touch3 test'
bzr branch ${BZRBRANCH}_git/.git/bzr/repo/master ${BZRBRANCH}_git/.git/bzr/repo/pushed
git fast-export --import-marks=${BZRBRANCH}_git/.git/bzr/map/master-git \
                --export-marks=${BZRBRANCH}_git/.git/bzr/map/pushed-git \
                pushed | \
    bzr fast-import --import-marks=${BZRBRANCH}_git/.git/bzr/map/master-bzr \
                    --export-marks=${BZRBRANCH}_git/.git/bzr/map/pushed-bzr \
                    - \
                    ${BZRBRANCH}_git/.git/bzr/repo/pushed

# -- captured output (git fast-export) --
#blob
#mark :3
#data 7
#touch3

#commit refs/heads/pushed
#mark :4
#author termie <email address hidden> 1296532204 -0800
#committer termie <email address hidden> 1296532204 -0800
#data 12
#touch3 test
#from :2
#M 100644 :3 touch2.txt

« Back to merge proposal