annotate tests/test-inotify-debuginotify.t @ 18757:1c8e0d6ac3b0 stable

localrepo: always write the filtered phasecache when nodes are destroyed (issue3827) When the strip command is run, it calls repo.destroyed, which in turn checks if we read _phasecache, and if we did calls filterunknown on it and flushes the changes immediately. But in some cases, nothing causes _phasecache to be read, so we miss out on this and the file remains the same on-disk. Then a call to invalidate comes, which should refresh _phasecache if it changed, but it didn't, so it keeps using the old one with the stripped revision which causes an IndexError. Test written by Yuya Nishihara.
author Idan Kamara <idankk86@gmail.com>
date Sat, 23 Mar 2013 13:34:50 +0200
parents 17ebf11bff81
children 104e120416ec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8555
3e09bc5fee12 inotify: introduce debuginotify, which lists which paths are under watch
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
1
12451
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
2 $ "$TESTDIR/hghave" inotify || exit 80
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
3 $ hg init
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
4 $ echo "[extensions]" >> $HGRCPATH
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
5 $ echo "inotify=" >> $HGRCPATH
8555
3e09bc5fee12 inotify: introduce debuginotify, which lists which paths are under watch
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
6
12451
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
7 inserve
8555
3e09bc5fee12 inotify: introduce debuginotify, which lists which paths are under watch
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
8
12451
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
9 $ hg inserve -d --pid-file=hg.pid
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
10 $ cat hg.pid >> "$DAEMON_PIDS"
8555
3e09bc5fee12 inotify: introduce debuginotify, which lists which paths are under watch
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
11
12451
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
12 let the daemon finish its stuff
8555
3e09bc5fee12 inotify: introduce debuginotify, which lists which paths are under watch
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
13
12451
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
14 $ sleep 1
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
15
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
16 empty
8555
3e09bc5fee12 inotify: introduce debuginotify, which lists which paths are under watch
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
17
12451
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
18 $ hg debuginotify
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
19 directories being watched:
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
20 /
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
21 .hg/
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
22 $ mkdir a
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
23 $ sleep 1
8555
3e09bc5fee12 inotify: introduce debuginotify, which lists which paths are under watch
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
24
12451
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
25 only 'a
8555
3e09bc5fee12 inotify: introduce debuginotify, which lists which paths are under watch
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
26
12451
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
27 $ hg debuginotify
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
28 directories being watched:
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
29 /
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
30 .hg/
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
31 a/
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
32 $ rmdir a
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
33 $ sleep 1
8555
3e09bc5fee12 inotify: introduce debuginotify, which lists which paths are under watch
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
34
12451
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
35 empty again
8555
3e09bc5fee12 inotify: introduce debuginotify, which lists which paths are under watch
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
36
12451
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
37 $ hg debuginotify
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
38 directories being watched:
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
39 /
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
40 .hg/
17ebf11bff81 tests: unify test-inotify-debuginotify
Matt Mackall <mpm@selenic.com>
parents: 8555
diff changeset
41 $ kill `cat hg.pid`