tests/test-inotify
author Patrick Mezard <pmezard@gmail.com>
Tue, 10 Nov 2009 11:57:03 +0100
changeset 9817 912ce84eebae
parent 9117 a87bc6e2a907
child 9854 95e1867f765b
permissions -rwxr-xr-x
hghave: be more tolerant to rst2html output On Windows, rst2html.bat calls rst2html.py, printing something like: "rst2html.py (Docutils" (notice the extra ".py")
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     5
hg init
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     6
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     7
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
     8
mkdir dir
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     9
mkdir dir/bar
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    10
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
    11
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    12
hg ci -Am m
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    13
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    14
echo "[extensions]" >> $HGRCPATH
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    15
echo "inotify=" >> $HGRCPATH
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 % inserve
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    18
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
    19
cat hg.pid >> "$DAEMON_PIDS"
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    20
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    21
# 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
    22
sleep 1
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    23
# issue907
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    24
hg status
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    25
echo % clean
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    26
hg status -c
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    27
echo % all
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    28
hg status -A
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    29
7393
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
    30
echo '% path patterns'
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
    31
echo x > dir/x
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
    32
hg status .
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
    33
hg status dir
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
    34
cd dir
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
    35
hg status .
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
    36
cd ..
92c952c4470c inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents: 7351
diff changeset
    37
9116
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    38
#issue 1375
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    39
#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
    40
echo % issue 1375
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    41
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    42
mkdir h
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    43
echo h > h/h
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    44
hg ci -Am t
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    45
hg rm h
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    46
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    47
echo h >h
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    48
hg add h
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    49
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    50
hg status
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    51
hg ci -m0
f90bbf1ea09f inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7393
diff changeset
    52
9117
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    53
# 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
    54
hg st
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    55
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    56
echo a > a
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    57
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    58
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
    59
hg st
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    60
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    61
echo b >> a
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    62
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
    63
hg st
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    64
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    65
echo c >> a
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    66
hg st
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    67
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    68
hg up 0
a87bc6e2a907 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9116
diff changeset
    69
hg st
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
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
    72
hg st
7145
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    73
kill `cat hg.pid`