test-hardlinks-safety
82 lines
| 1.2 KiB
| text/plain
|
TextLexer
/ tests / test-hardlinks-safety
Benoit Boissinot
|
r6835 | #!/bin/sh | ||
Christian Ebert
|
r6920 | # some implementations of cp can't create hardlinks | ||
cat > cp.py <<EOF | ||||
from mercurial import util | ||||
import sys | ||||
util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True) | ||||
EOF | ||||
# test hardlinking outside hg | ||||
mkdir x | ||||
echo foo > x/a | ||||
python cp.py x y | ||||
echo bar >> y/a | ||||
echo % no diff if hardlink | ||||
diff x/a y/a | ||||
Benoit Boissinot
|
r6835 | # test mq hardlinking | ||
echo "[extensions]" >> $HGRCPATH | ||||
echo "mq=" >> $HGRCPATH | ||||
echo % init | ||||
hg init a | ||||
cd a | ||||
hg qimport -n foo - << EOF | ||||
Thomas Arendsen Hein
|
r6869 | # HG changeset patch | ||
# Date 1 0 | ||||
Benoit Boissinot
|
r6835 | diff -r 2588a8b53d66 a | ||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 | ||||
+++ b/a Wed Jul 23 15:54:29 2008 +0200 | ||||
@@ -0,0 +1,1 @@ | ||||
+a | ||||
EOF | ||||
hg qpush | ||||
cd .. | ||||
Christian Ebert
|
r6920 | python cp.py a b | ||
Benoit Boissinot
|
r6835 | cd b | ||
hg qimport -n bar - << EOF | ||||
Thomas Arendsen Hein
|
r6869 | # HG changeset patch | ||
# Date 2 0 | ||||
Benoit Boissinot
|
r6835 | diff -r 2588a8b53d66 a | ||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 | ||||
+++ b/b Wed Jul 23 15:54:29 2008 +0200 | ||||
@@ -0,0 +1,1 @@ | ||||
+b | ||||
EOF | ||||
hg qpush | ||||
cat .hg/patches/status | ||||
echo % | ||||
cat .hg/patches/series | ||||
echo %%% | ||||
cat ../a/.hg/patches/status | ||||
echo % | ||||
cat ../a/.hg/patches/series | ||||
# test tags hardlinking | ||||
hg qdel -r qbase:qtip | ||||
hg tag -l lfoo | ||||
hg tag foo | ||||
cd .. | ||||
Christian Ebert
|
r6920 | python cp.py b c | ||
Benoit Boissinot
|
r6835 | cd c | ||
hg tag -l -r 0 lbar | ||||
hg tag -r 0 bar | ||||
echo %%% | ||||
cat .hgtags | ||||
echo % | ||||
cat .hg/localtags | ||||
echo %%% | ||||
cat ../b/.hgtags | ||||
echo % | ||||
cat ../b/.hg/localtags | ||||