comparison tests/test-hardlinks-safety @ 6835:08d9e0f974d9

make mq and tags hardlink safe The code didn't check for modes like "r+" or "rb+". Many thanks to agriffis for noticing it.
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 23 Jul 2008 16:08:20 +0200
parents
children b49e01863202
comparison
equal deleted inserted replaced
6815:7d6622eaad08 6835:08d9e0f974d9
1 #!/bin/sh
2
3 # test mq hardlinking
4 echo "[extensions]" >> $HGRCPATH
5 echo "mq=" >> $HGRCPATH
6
7 echo % init
8 hg init a
9 cd a
10
11 hg qimport -n foo - << EOF
12 diff -r 2588a8b53d66 a
13 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14 +++ b/a Wed Jul 23 15:54:29 2008 +0200
15 @@ -0,0 +1,1 @@
16 +a
17 EOF
18
19 hg qpush
20
21 cd ..
22 cp -al a b
23 cd b
24
25 hg qimport -n bar - << EOF
26 diff -r 2588a8b53d66 a
27 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
28 +++ b/b Wed Jul 23 15:54:29 2008 +0200
29 @@ -0,0 +1,1 @@
30 +b
31 EOF
32
33 hg qpush
34
35 cat .hg/patches/status
36 echo %
37 cat .hg/patches/series
38 echo %%%
39 cat ../a/.hg/patches/status
40 echo %
41 cat ../a/.hg/patches/series
42
43 # test tags hardlinking
44 hg qdel -r qbase:qtip
45
46 hg tag -l lfoo
47 hg tag foo
48
49 cd ..
50 cp -al b c
51 cd c
52
53 hg tag -l -r 0 lbar
54 hg tag -r 0 bar
55 echo %%%
56 cat .hgtags
57 echo %
58 cat .hg/localtags
59 echo %%%
60 cat ../b/.hgtags
61 echo %
62 cat ../b/.hg/localtags