#!/bin/sh echo "[extensions]" >> $HGRCPATH echo "relink=" >> $HGRCPATH fix_path() { tr '\\' / } cat > arelinked.py < .hg/hgrc echo 'username= A. Foo ' >> .hg/hgrc echo a > a echo b > b hg ci -Am addfile echo a >> a echo a >> b hg ci -Am changefiles # Test files are read in binary mode python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')" cd .. echo '% clone and pull to break links' hg clone --pull -r0 repo clone cd clone echo '[ui]' >> .hg/hgrc echo 'username= A. Baz ' >> .hg/hgrc hg pull -q echo b >> b hg ci -m changeb python -c "file('.hg/store/data/dummy.i', 'wb').write('a\nb\r\n')" echo '% relink' hg relink --debug | sed 's:relinking.*store:relinking .hg/store:g' \ | fix_path cd .. echo '% check hardlinks' python arelinked.py repo/.hg/store/data/a.i clone/.hg/store/data/a.i python arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i