tests/test-inotify
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
Tue, 11 Nov 2008 23:16:59 +0100
changeset 7350 c5dbe86b0fee
parent 7145 6f4a253f2a64
child 7351 5ab0abf27dd9
permissions -rwxr-xr-x
inotify: fix replacing a folder with a file (issue1375)
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
7350
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    16
echo "[inotify]" >> $HGRCPATH
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    17
echo "debug=1" >> $HGRCPATH
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    18
echo "log=/tmp/inot.log" >> $HGRCPATH
7145
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    19
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    20
echo % inserve
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    21
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
    22
cat hg.pid >> "$DAEMON_PIDS"
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    23
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    24
# 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
    25
sleep 1
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    26
# issue907
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    27
hg status
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    28
echo % clean
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    29
hg status -c
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    30
echo % all
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    31
hg status -A
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    32
7350
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    33
#issue 1375
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    34
#Testing that we can remove a folder and then add a file with the same name
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    35
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    36
mkdir h f g
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    37
echo h > h/h
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    38
echo f > f/f
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    39
echo g > g/g
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    40
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    41
hg ci -Am t
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    42
sleep 1
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    43
hg rm h
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    44
hg rm f
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    45
sleep 1
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    46
echo h >h
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    47
ln -s g f
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    48
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    49
hg add h
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    50
sleep 1
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    51
hg add f
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    52
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    53
hg status
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    54
hg ci -m0
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    55
hg status
7145
6f4a253f2a64 inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    56
kill `cat hg.pid`
7350
c5dbe86b0fee inotify: fix replacing a folder with a file (issue1375)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7145
diff changeset
    57