Mercurial > hg
annotate tests/test-inotify.t @ 17474:f85816af6294
obsolete: add a high level function to create an obsolete marker
This function is designed to be used by all code that creates new
obsolete markers in the local repository.
It is not used by debugobsolete because debugobsolete allows the
use of an unknown hash as argument.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Fri, 24 Aug 2012 21:16:23 +0200 |
parents | f2719b387380 |
children | 8cbe0fed0c1f |
rev | line source |
---|---|
7145
6f4a253f2a64
inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
1 |
12450 | 2 $ "$TESTDIR/hghave" inotify || exit 80 |
3 $ hg init repo1 | |
4 $ cd repo1 | |
5 $ touch a b c d e | |
6 $ mkdir dir | |
7 $ mkdir dir/bar | |
8 $ touch dir/x dir/y dir/bar/foo | |
9 $ hg ci -Am m | |
10 adding a | |
11 adding b | |
12 adding c | |
13 adding d | |
14 adding dir/bar/foo | |
15 adding dir/x | |
16 adding dir/y | |
17 adding e | |
18 $ cd .. | |
19 $ hg clone repo1 repo2 | |
20 updating to branch default | |
21 8 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
22 $ echo "[extensions]" >> $HGRCPATH | |
23 $ echo "inotify=" >> $HGRCPATH | |
24 $ cd repo2 | |
25 $ echo b >> a | |
7145
6f4a253f2a64
inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
26 |
12450 | 27 check that daemon started automatically works correctly |
28 and make sure that inotify.pidfile works | |
7145
6f4a253f2a64
inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
29 |
12450 | 30 $ hg --config "inotify.pidfile=../hg2.pid" status |
31 M a | |
32 | |
33 make sure that pidfile worked. Output should be silent. | |
9897
97eda2133a9b
inotify: add a inotify.pidfile configuration possibility
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9896
diff
changeset
|
34 |
12450 | 35 $ kill `cat ../hg2.pid` |
36 $ cd ../repo1 | |
37 | |
38 inserve | |
39 | |
40 $ hg inserve -d --pid-file=hg.pid | |
41 $ cat hg.pid >> "$DAEMON_PIDS" | |
9896
2c2f7593ffc4
cmdutil.service: do not _exit(0) in the parent process
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9854
diff
changeset
|
42 |
12450 | 43 let the daemon finish its stuff |
44 | |
45 $ sleep 1 | |
7145
6f4a253f2a64
inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
46 |
12450 | 47 cannot start, already bound |
9900
8939900073a8
inotify: improve error messages
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9897
diff
changeset
|
48 |
12450 | 49 $ hg inserve |
50 abort: inotify-server: cannot start: socket is already bound | |
51 [255] | |
9900
8939900073a8
inotify: improve error messages
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9897
diff
changeset
|
52 |
12450 | 53 issue907 |
54 | |
55 $ hg status | |
56 ? hg.pid | |
57 | |
58 clean | |
7145
6f4a253f2a64
inotify: fix status not showing "clean" files (issue907)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
59 |
12450 | 60 $ hg status -c |
61 C a | |
62 C b | |
63 C c | |
64 C d | |
65 C dir/bar/foo | |
66 C dir/x | |
67 C dir/y | |
68 C e | |
69 | |
70 all | |
7393
92c952c4470c
inotify: fix status . in repo.root
Brendan Cully <brendan@kublai.com>
parents:
7351
diff
changeset
|
71 |
12450 | 72 $ hg status -A |
73 ? hg.pid | |
74 C a | |
75 C b | |
76 C c | |
77 C d | |
78 C dir/bar/foo | |
79 C dir/x | |
80 C dir/y | |
81 C e | |
9116
f90bbf1ea09f
inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
7393
diff
changeset
|
82 |
12450 | 83 path patterns |
9116
f90bbf1ea09f
inotify: fix issue1375, add a test.
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
7393
diff
changeset
|
84 |
12450 | 85 $ echo x > dir/x |
86 $ hg status . | |
87 M dir/x | |
88 ? hg.pid | |
89 $ hg status dir | |
90 M dir/x | |
91 $ cd dir | |
92 $ hg status . | |
93 M x | |
94 $ cd .. | |
9117
a87bc6e2a907
inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9116
diff
changeset
|
95 |
12450 | 96 issue 1375 |
97 testing that we can remove a folder and then add a file with the same name | |
98 issue 1375 | |
9117
a87bc6e2a907
inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9116
diff
changeset
|
99 |
12450 | 100 $ mkdir h |
101 $ echo h > h/h | |
102 $ hg ci -Am t | |
103 adding h/h | |
104 adding hg.pid | |
105 $ hg rm h | |
106 removing h/h | |
107 $ echo h >h | |
108 $ hg add h | |
109 $ hg status | |
110 A h | |
111 R h/h | |
112 $ hg ci -m0 | |
9117
a87bc6e2a907
inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9116
diff
changeset
|
113 |
12450 | 114 Test for issue1735: inotify watches files in .hg/merge |
9117
a87bc6e2a907
inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9116
diff
changeset
|
115 |
12450 | 116 $ hg st |
117 $ echo a > a | |
118 $ hg ci -Am a | |
119 $ hg st | |
120 $ echo b >> a | |
121 $ hg ci -m ab | |
122 $ hg st | |
123 $ echo c >> a | |
124 $ hg st | |
125 M a | |
126 $ HGMERGE=internal:local hg up 0 | |
127 1 files updated, 1 files merged, 2 files removed, 0 files unresolved | |
128 $ hg st | |
129 M a | |
130 $ HGMERGE=internal:local hg up | |
131 3 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
132 $ hg st | |
133 M a | |
9854
95e1867f765b
inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9117
diff
changeset
|
134 |
12450 | 135 Test for 1844: "hg ci folder" will not commit all changes beneath "folder" |
9854
95e1867f765b
inotify: mark directories visited during lookup (issue1844)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9117
diff
changeset
|
136 |
12450 | 137 $ mkdir 1844 |
138 $ echo a > 1844/foo | |
139 $ hg add 1844 | |
140 adding 1844/foo | |
141 $ hg ci -m 'working' | |
142 $ echo b >> 1844/foo | |
143 $ hg ci 1844 -m 'broken' | |
144 | |
145 Test for issue884: "Build products not ignored until .hgignore is touched" | |
11545
db9d16233787
inotify: check all components of filenames against hgignore (issue884)
Renato Cunha <renatoc@gmail.com>
parents:
10944
diff
changeset
|
146 |
12450 | 147 $ echo '^build$' > .hgignore |
148 $ hg add .hgignore | |
149 $ hg ci .hgignore -m 'ignorelist' | |
150 | |
151 Now, lets add some build products... | |
11545
db9d16233787
inotify: check all components of filenames against hgignore (issue884)
Renato Cunha <renatoc@gmail.com>
parents:
10944
diff
changeset
|
152 |
12450 | 153 $ mkdir build |
154 $ touch build/x | |
155 $ touch build/y | |
11545
db9d16233787
inotify: check all components of filenames against hgignore (issue884)
Renato Cunha <renatoc@gmail.com>
parents:
10944
diff
changeset
|
156 |
12450 | 157 build/x & build/y shouldn't appear in "hg st" |
158 | |
159 $ hg st | |
160 $ kill `cat hg.pid` | |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
12450
diff
changeset
|
161 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
12450
diff
changeset
|
162 $ cd .. |