annotate tests/test-inotify @ 9899:be574a37a8ae stable

run-tests: give each child its own tmp dir (issue1911) Fixes bug introduced by f8b4df4b033d (issue1911: --tmpdir plus parallel mode = fail), and also fixes the long-standing quirk that parallel mode created multiple /tmp/hgtests.XXXXXX directories. Now there is only one /tmp/hgtests.XXXXXX, with child0, child1, etc. under it.
author Greg Ward <greg@gerg.ca>
date Wed, 18 Nov 2009 22:23:11 -0500
parents 97eda2133a9b
children 8939900073a8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7145
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
1 #!/bin/sh
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
2
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
3 "$TESTDIR/hghave" inotify || exit 80
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
4
9896
2c2f7593ffc4 cmdutil.service: do not _exit(0) in the parent process
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9854
diff changeset
5 hg init repo1
2c2f7593ffc4 cmdutil.service: do not _exit(0) in the parent process
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9854
diff changeset
6 cd repo1
7145
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
7
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
8 touch a b c d e
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
9 mkdir dir
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
10 mkdir dir/bar
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
11 touch dir/x dir/y dir/bar/foo
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
12
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
13 hg ci -Am m
9896
2c2f7593ffc4 cmdutil.service: do not _exit(0) in the parent process
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9854
diff changeset
14 cd ..
2c2f7593ffc4 cmdutil.service: do not _exit(0) in the parent process
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9854
diff changeset
15 hg clone repo1 repo2
7145
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
16
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
17 echo "[extensions]" >> $HGRCPATH
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
18 echo "inotify=" >> $HGRCPATH
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
19
9896
2c2f7593ffc4 cmdutil.service: do not _exit(0) in the parent process
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9854
diff changeset
20 cd repo2
2c2f7593ffc4 cmdutil.service: do not _exit(0) in the parent process
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9854
diff changeset
21 echo b >> a
2c2f7593ffc4 cmdutil.service: do not _exit(0) in the parent process
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9854
diff changeset
22 # check that daemon started automatically works correctly
9897
97eda2133a9b inotify: add a inotify.pidfile configuration possibility
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9896
diff changeset
23 # and make sure that inotify.pidfile works
97eda2133a9b inotify: add a inotify.pidfile configuration possibility
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9896
diff changeset
24 hg --config "inotify.pidfile=../hg2.pid" status
97eda2133a9b inotify: add a inotify.pidfile configuration possibility
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9896
diff changeset
25
97eda2133a9b inotify: add a inotify.pidfile configuration possibility
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9896
diff changeset
26 # make sure that pidfile worked. Output should be silent.
97eda2133a9b inotify: add a inotify.pidfile configuration possibility
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9896
diff changeset
27 kill `cat ../hg2.pid`
9896
2c2f7593ffc4 cmdutil.service: do not _exit(0) in the parent process
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9854
diff changeset
28
2c2f7593ffc4 cmdutil.service: do not _exit(0) in the parent process
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9854
diff changeset
29 cd ../repo1
7145
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
30 echo % inserve
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
31 hg inserve -d --pid-file=hg.pid
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
32 cat hg.pid >> "$DAEMON_PIDS"
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
33
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
34 # let the daemon finish its stuff
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
35 sleep 1
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
36 # issue907
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
37 hg status
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
38 echo % clean
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
39 hg status -c
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
40 echo % all
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
41 hg status -A
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
42
7393
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
43 echo '% path patterns'
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
44 echo x > dir/x
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
45 hg status .
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
46 hg status dir
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
47 cd dir
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
48 hg status .
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
49 cd ..
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
50
9116
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
51 #issue 1375
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
52 #Testing that we can remove a folder and then add a file with the same name
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
53 echo % issue 1375
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
54
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
55 mkdir h
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
56 echo h > h/h
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
57 hg ci -Am t
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
58 hg rm h
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
59
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
60 echo h >h
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
61 hg add h
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
62
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
63 hg status
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
64 hg ci -m0
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
65
9117
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
66 # Test for issue1735: inotify watches files in .hg/merge
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
67 hg st
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
68
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
69 echo a > a
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
70
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
71 hg ci -Am a
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
72 hg st
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
73
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
74 echo b >> a
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
75 hg ci -m ab
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
76 hg st
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
77
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
78 echo c >> a
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
79 hg st
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
80
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
81 hg up 0
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
82 hg st
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
83
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
84 HGMERGE=internal:local hg up
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
85 hg st
9854
95e1867f765b inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9117
diff changeset
86
95e1867f765b inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9117
diff changeset
87 # Test for 1844: "hg ci folder" will not commit all changes beneath "folder"
95e1867f765b inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9117
diff changeset
88 mkdir 1844
95e1867f765b inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9117
diff changeset
89 echo a > 1844/foo
95e1867f765b inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9117
diff changeset
90 hg add 1844
95e1867f765b inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9117
diff changeset
91 hg ci -m 'working'
95e1867f765b inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9117
diff changeset
92
95e1867f765b inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9117
diff changeset
93 echo b >> 1844/foo
95e1867f765b inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9117
diff changeset
94 hg ci 1844 -m 'broken'
95e1867f765b inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9117
diff changeset
95
7145
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
96 kill `cat hg.pid`