view tests/test-relink @ 10301:56b50194617f

templates: rename `Last change' column in hgwebdir repository list. This patch changes column headers in the templates that previously said `Last change' to `Last modified'. Neither code nor functionality are changed other than that. For some time now, I have been annoyed by the fact the `Last change' column didn't list the age of the youngest changeset in the repository, or at least tip. It just occurred to me that this is because the wording is slightly misleading; what the column in fact lists is when the repository was last *modified*, that is, when changesets was last added or removed from it. The word `change' can be understood as referring to the changeset itself. Using `changed' would be ever so slightly less amigous. However, the standard nomenclature in this case is `modification date' and `Last modified', which is incidentally entirely unambigous. Hence, `Last modified' is the wording used.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sun, 24 Jan 2010 20:51:53 +0100
parents 750b7a4f01f6
children
line wrap: on
line source

#!/bin/sh

echo "[extensions]" >> $HGRCPATH
echo "relink=" >> $HGRCPATH

fix_path()
{
    tr '\\' /
}

cat > arelinked.py <<EOF
import sys, os
from mercurial import util
path1, path2 = sys.argv[1:3]
if util.samefile(path1, path2):
    print '%s == %s' % (path1, path2)
else:
    print '%s != %s' % (path1, path2)
EOF

echo '% create source repository'
hg init repo
cd repo
echo '[ui]' > .hg/hgrc
echo 'username= A. Foo <a.foo@bar.com>' >> .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 <a.baz@bar.com>' >> .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