view tests/test-convert-tla @ 6297:fed1a9c22076

dirstate.remove: during merges, remember the previous file state We encode the previous state as a negative file size (AFAICS, previous versions of hg always have size == 0 when state == 'r'). We save the state of 'm'erged and dirty files, because they're the two states that indicate that a file has to be committed on a merge to correctly record per-file history.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Tue, 18 Mar 2008 04:07:39 -0300
parents abb1c451a88e
children 12d1e1e79faf
line wrap: on
line source

#!/bin/sh

"$TESTDIR/hghave" tla || exit 80

mkdir do_not_use_HOME_tla
cd do_not_use_HOME_tla
HOME=`pwd`; export HOME
cd ..
tla my-id "mercurial <mercurial@selenic.com>"

echo "[extensions]" >> $HGRCPATH
echo "convert=" >> $HGRCPATH
echo 'hgext.graphlog =' >> $HGRCPATH

echo % create tla archive
tla make-archive tla@mercurial--convert `pwd`/hg-test-convert-tla

echo % initialize tla repo
mkdir tla-repo
cd tla-repo/
tla init-tree tla@mercurial--convert/tla--test--0
tla import

echo % create initial files
echo 'this is a file' > a
tla add a
mkdir src
tla add src
cd src
dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
tla add b
tla commit -s "added a file, src and src/b (binary)"

echo % create link file and modify a
ln -s ../a a-link
tla add a-link
echo 'this a modification to a' >> ../a
tla commit -s "added link to a and modify a"

echo % create second link and modify b
ln -s ../a a-link-2
tla add a-link-2
dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
tla commit -s "added second link and modify b"

echo % b file to link and a-link-2 to regular file
rm -f a-link-2
echo 'this is now a regular file' > a-link-2
ln -sf ../a b
tla commit -s "file to link and link to file test"

echo % move a-link-2 file and src directory
cd ..
tla mv src/a-link-2 c
tla mv src test
tla commit -s "move and rename a-link-2 file and src directory"

cd ..

echo % converting tla repo to Mercurial
hg convert tla-repo tla-repo-hg

tla register-archive -d tla@mercurial--convert

glog()
{
    hg glog --template '#rev# "#desc|firstline#" files: #files#\n' "$@"
}

echo % show graph log
glog -R tla-repo-hg
hg -R tla-repo-hg manifest --debug