view tests/test-clone @ 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 2770d03ae49f
children 07e425d63dbd
line wrap: on
line source

#!/bin/sh

echo
echo % prepare repo a
mkdir a
cd a
hg init
echo a > a
hg add a
hg commit -m test
echo first line > b
hg add b
# create a non-inlined filelog
python -c 'for x in range(10000): print x' >> data1
for j in 0 1 2 3 4 5 6 7 8 9; do
    cat data1 >> b
    hg commit -m test
done
echo % "list files in store/data (should show a 'b.d')"
for i in .hg/store/data/*; do
    echo $i
done

echo
echo % default operation
hg clone . ../b
cd ../b
cat a
hg verify

echo
echo % no update
hg clone -U . ../c
cd ../c
cat a 2>/dev/null || echo "a not present"
hg verify

echo
echo % default destination
mkdir ../d
cd ../d
hg clone ../a
cd a
hg cat a

echo
echo % "check that we drop the file: from the path before"
echo % "writing the .hgrc"
cd ../..
hg clone file:a e
grep 'file:' e/.hg/hgrc

echo
echo % check that path aliases are expanded
hg clone -q -U --config 'paths.foobar=a#0' foobar f
hg -R f showconfig paths.default | sed -e 's,.*/,,'

echo
echo % use --pull
hg clone --pull a g
hg -R g verify

echo
echo % clone to '.'
mkdir h
cd h
hg clone ../a .
cd ..

echo
echo
echo % "*** tests for option -u ***"
echo


echo
echo % "adding some more history to repo a"
cd a
echo % "tag ref1"
hg tag ref1
echo the quick brown fox >a
hg ci -m "hacked default"
echo % "updating back to ref1"
hg up ref1
echo
echo % "add branch 'stable' to repo a for later tests"
hg branch stable
echo some text >a
hg ci -m "starting branch stable"
echo % "tag ref2"
hg tag ref2
echo some more text >a
hg ci -m "another change for branch stable"
echo
echo % "updating back to ref2"
hg up ref2
echo
echo % "parents of repo a"
hg parents
echo
echo % "repo a has two heads"
hg heads
cd ..

echo
echo % "testing clone -U -u 1 a ua (must abort)"
hg clone -U -u 1 a ua

echo
echo % "testing clone -u . a ua"
hg clone -u . a ua
echo
echo % "repo ua has both heads"
hg -R ua heads
echo
echo % "same revision checked out in repo a and ua"
hg -R a parents --template "{node|short}\n"
hg -R ua parents --template "{node|short}\n"
rm -r ua

echo
echo % "testing clone --pull -u . a ua"
hg clone --pull -u . a ua
echo
echo % "repo ua has both heads"
hg -R ua heads
echo
echo % "same revision checked out in repo a and ua"
hg -R a parents --template "{node|short}\n"
hg -R ua parents --template "{node|short}\n"
rm -r ua

echo
echo % "testing clone -u stable a ua"
hg clone -u stable a ua
echo
echo % "repo ua has both heads"
hg -R ua heads
echo
echo % "branch stable is checked out"
hg -R ua parents
rm -r ua

echo
echo % "testing clone a ua"
hg clone a ua
echo
echo % "repo ua has both heads"
hg -R ua heads
echo
echo % "branch default is checked out"
hg -R ua parents
rm -r ua

echo
echo % "testing clone -u . a#stable ua"
hg clone -u . a#stable ua
echo
echo % "repo ua has only branch stable"
hg -R ua heads
echo
echo % "same revision checked out in repo a and ua"
hg -R a parents --template "{node|short}\n"
hg -R ua parents --template "{node|short}\n"
rm -r ua

echo
echo % "testing clone -u . -r stable a ua"
hg clone -u . -r stable a ua
echo
echo % "repo ua has only branch stable"
hg -R ua heads
echo
echo % "same revision checked out in repo a and ua"
hg -R a parents --template "{node|short}\n"
hg -R ua parents --template "{node|short}\n"
rm -r ua

echo
echo % "testing clone -r stable a ua"
hg clone -r stable a ua
echo
echo % "repo ua has only branch stable"
hg -R ua heads
echo
echo % "branch stable is checked out"
hg -R ua parents
rm -r ua

echo
echo % "testing clone -u . -r stable -r default a ua"
hg clone -u . -r stable -r default a ua
echo
echo % "repo ua has two heads"
hg -R ua heads
echo
echo % "same revision checked out in repo a and ua"
hg -R a parents --template "{node|short}\n"
hg -R ua parents --template "{node|short}\n"
rm -r ua

exit 0