##// END OF EJS Templates
tests: add extra output for fsmonitor at checking under .hg
FUJIWARA Katsunori -
r33427:1bdafe11 default
parent child Browse files
Show More
@@ -1,34 +1,31 b''
1 1 # Blacklist for a full testsuite run with fsmonitor enabled.
2 2 # Used by fsmonitor-run-tests.
3 3 # The following tests all fail because they either use extensions that conflict
4 4 # with fsmonitor, use subrepositories, or don't anticipate the extra file in
5 5 # the .hg directory that fsmonitor adds.
6 6 test-debugextensions.t
7 7 test-eol-add.t
8 8 test-eol-clone.t
9 9 test-eol-hook.t
10 10 test-eol-patch.t
11 11 test-eol-tag.t
12 12 test-eol-update.t
13 13 test-eol.t
14 14 test-eolfilename.t
15 15 test-extension.t
16 test-fncache.t
17 test-hardlinks.t
18 16 test-help.t
19 test-inherit-mode.t
20 17 test-issue3084.t
21 18 test-largefiles-cache.t
22 19 test-largefiles-misc.t
23 20 test-largefiles-small-disk.t
24 21 test-largefiles-update.t
25 22 test-largefiles-wireproto.t
26 23 test-largefiles.t
27 24 test-lfconvert.t
28 25 test-nested-repo.t
29 26 test-permissions.t
30 27 test-push-warn.t
31 28 test-subrepo-deep-nested-change.t
32 29 test-subrepo-recursion.t
33 30 test-subrepo.t
34 31 test-tags.t
@@ -1,417 +1,419 b''
1 1 Init repo1:
2 2
3 3 $ hg init repo1
4 4 $ cd repo1
5 5 $ echo "some text" > a
6 6 $ hg add
7 7 adding a
8 8 $ hg ci -m first
9 9 $ cat .hg/store/fncache | sort
10 10 data/a.i
11 11
12 12 Testing a.i/b:
13 13
14 14 $ mkdir a.i
15 15 $ echo "some other text" > a.i/b
16 16 $ hg add
17 17 adding a.i/b (glob)
18 18 $ hg ci -m second
19 19 $ cat .hg/store/fncache | sort
20 20 data/a.i
21 21 data/a.i.hg/b.i
22 22
23 23 Testing a.i.hg/c:
24 24
25 25 $ mkdir a.i.hg
26 26 $ echo "yet another text" > a.i.hg/c
27 27 $ hg add
28 28 adding a.i.hg/c (glob)
29 29 $ hg ci -m third
30 30 $ cat .hg/store/fncache | sort
31 31 data/a.i
32 32 data/a.i.hg.hg/c.i
33 33 data/a.i.hg/b.i
34 34
35 35 Testing verify:
36 36
37 37 $ hg verify
38 38 checking changesets
39 39 checking manifests
40 40 crosschecking files in changesets and manifests
41 41 checking files
42 42 3 files, 3 changesets, 3 total revisions
43 43
44 44 $ rm .hg/store/fncache
45 45
46 46 $ hg verify
47 47 checking changesets
48 48 checking manifests
49 49 crosschecking files in changesets and manifests
50 50 checking files
51 51 warning: revlog 'data/a.i' not in fncache!
52 52 warning: revlog 'data/a.i.hg/c.i' not in fncache!
53 53 warning: revlog 'data/a.i/b.i' not in fncache!
54 54 3 files, 3 changesets, 3 total revisions
55 55 3 warnings encountered!
56 56 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
57 57
58 58 Follow the hint to make sure it works
59 59
60 60 $ hg debugrebuildfncache
61 61 adding data/a.i
62 62 adding data/a.i.hg/c.i
63 63 adding data/a.i/b.i
64 64 3 items added, 0 removed from fncache
65 65
66 66 $ hg verify
67 67 checking changesets
68 68 checking manifests
69 69 crosschecking files in changesets and manifests
70 70 checking files
71 71 3 files, 3 changesets, 3 total revisions
72 72
73 73 $ cd ..
74 74
75 75 Non store repo:
76 76
77 77 $ hg --config format.usestore=False init foo
78 78 $ cd foo
79 79 $ mkdir tst.d
80 80 $ echo foo > tst.d/foo
81 81 $ hg ci -Amfoo
82 82 adding tst.d/foo
83 83 $ find .hg | sort
84 84 .hg
85 85 .hg/00changelog.i
86 86 .hg/00manifest.i
87 87 .hg/cache
88 88 .hg/cache/branch2-served
89 89 .hg/cache/rbc-names-v1
90 90 .hg/cache/rbc-revs-v1
91 91 .hg/data
92 92 .hg/data/tst.d.hg
93 93 .hg/data/tst.d.hg/foo.i
94 94 .hg/dirstate
95 .hg/fsmonitor.state (fsmonitor !)
95 96 .hg/last-message.txt
96 97 .hg/phaseroots
97 98 .hg/requires
98 99 .hg/undo
99 100 .hg/undo.backup.dirstate
100 101 .hg/undo.backupfiles
101 102 .hg/undo.bookmarks
102 103 .hg/undo.branch
103 104 .hg/undo.desc
104 105 .hg/undo.dirstate
105 106 .hg/undo.phaseroots
106 107 $ cd ..
107 108
108 109 Non fncache repo:
109 110
110 111 $ hg --config format.usefncache=False init bar
111 112 $ cd bar
112 113 $ mkdir tst.d
113 114 $ echo foo > tst.d/Foo
114 115 $ hg ci -Amfoo
115 116 adding tst.d/Foo
116 117 $ find .hg | sort
117 118 .hg
118 119 .hg/00changelog.i
119 120 .hg/cache
120 121 .hg/cache/branch2-served
121 122 .hg/cache/rbc-names-v1
122 123 .hg/cache/rbc-revs-v1
123 124 .hg/dirstate
125 .hg/fsmonitor.state (fsmonitor !)
124 126 .hg/last-message.txt
125 127 .hg/requires
126 128 .hg/store
127 129 .hg/store/00changelog.i
128 130 .hg/store/00manifest.i
129 131 .hg/store/data
130 132 .hg/store/data/tst.d.hg
131 133 .hg/store/data/tst.d.hg/_foo.i
132 134 .hg/store/phaseroots
133 135 .hg/store/undo
134 136 .hg/store/undo.backupfiles
135 137 .hg/store/undo.phaseroots
136 138 .hg/undo.backup.dirstate
137 139 .hg/undo.bookmarks
138 140 .hg/undo.branch
139 141 .hg/undo.desc
140 142 .hg/undo.dirstate
141 143 $ cd ..
142 144
143 145 Encoding of reserved / long paths in the store
144 146
145 147 $ hg init r2
146 148 $ cd r2
147 149 $ cat <<EOF > .hg/hgrc
148 150 > [ui]
149 151 > portablefilenames = ignore
150 152 > EOF
151 153
152 154 $ hg import -q --bypass - <<EOF
153 155 > # HG changeset patch
154 156 > # User test
155 157 > # Date 0 0
156 158 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
157 159 > # Parent 0000000000000000000000000000000000000000
158 160 > 1
159 161 >
160 162 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
161 163 > new file mode 100644
162 164 > --- /dev/null
163 165 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
164 166 > @@ -0,0 +1,1 @@
165 167 > +foo
166 168 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
167 169 > new file mode 100644
168 170 > --- /dev/null
169 171 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
170 172 > @@ -0,0 +1,1 @@
171 173 > +foo
172 174 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
173 175 > new file mode 100644
174 176 > --- /dev/null
175 177 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
176 178 > @@ -0,0 +1,1 @@
177 179 > +foo
178 180 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
179 181 > new file mode 100644
180 182 > --- /dev/null
181 183 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
182 184 > @@ -0,0 +1,1 @@
183 185 > +foo
184 186 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
185 187 > new file mode 100644
186 188 > --- /dev/null
187 189 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
188 190 > @@ -0,0 +1,1 @@
189 191 > +foo
190 192 > EOF
191 193
192 194 $ find .hg/store -name *.i | sort
193 195 .hg/store/00changelog.i
194 196 .hg/store/00manifest.i
195 197 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
196 198 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
197 199 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
198 200 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
199 201 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
200 202
201 203 $ cd ..
202 204
203 205 Aborting lock does not prevent fncache writes
204 206
205 207 $ cat > exceptionext.py <<EOF
206 208 > import os
207 209 > from mercurial import commands, error
208 210 > from mercurial.extensions import wrapcommand, wrapfunction
209 211 >
210 212 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
211 213 > def releasewrap():
212 214 > l.held = False # ensure __del__ is a noop
213 215 > raise error.Abort("forced lock failure")
214 216 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
215 217 > return l
216 218 >
217 219 > def reposetup(ui, repo):
218 220 > wrapfunction(repo, '_lock', lockexception)
219 221 >
220 222 > cmdtable = {}
221 223 >
222 224 > # wrap "commit" command to prevent wlock from being '__del__()'-ed
223 225 > # at the end of dispatching (for intentional "forced lcok failure")
224 226 > def commitwrap(orig, ui, repo, *pats, **opts):
225 227 > repo = repo.unfiltered() # to use replaced repo._lock certainly
226 228 > wlock = repo.wlock()
227 229 > try:
228 230 > return orig(ui, repo, *pats, **opts)
229 231 > finally:
230 232 > # multiple 'relase()' is needed for complete releasing wlock,
231 233 > # because "forced" abort at last releasing store lock
232 234 > # prevents wlock from being released at same 'lockmod.release()'
233 235 > for i in range(wlock.held):
234 236 > wlock.release()
235 237 >
236 238 > def extsetup(ui):
237 239 > wrapcommand(commands.table, "commit", commitwrap)
238 240 > EOF
239 241 $ extpath=`pwd`/exceptionext.py
240 242 $ hg init fncachetxn
241 243 $ cd fncachetxn
242 244 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
243 245 $ touch y
244 246 $ hg ci -qAm y
245 247 abort: forced lock failure
246 248 [255]
247 249 $ cat .hg/store/fncache
248 250 data/y.i
249 251
250 252 Aborting transaction prevents fncache change
251 253
252 254 $ cat > ../exceptionext.py <<EOF
253 255 > import os
254 256 > from mercurial import commands, error, localrepo
255 257 > from mercurial.extensions import wrapfunction
256 258 >
257 259 > def wrapper(orig, self, *args, **kwargs):
258 260 > tr = orig(self, *args, **kwargs)
259 261 > def fail(tr):
260 262 > raise error.Abort("forced transaction failure")
261 263 > # zzz prefix to ensure it sorted after store.write
262 264 > tr.addfinalize('zzz-forcefails', fail)
263 265 > return tr
264 266 >
265 267 > def uisetup(ui):
266 268 > wrapfunction(localrepo.localrepository, 'transaction', wrapper)
267 269 >
268 270 > cmdtable = {}
269 271 >
270 272 > EOF
271 273 $ rm -f "${extpath}c"
272 274 $ touch z
273 275 $ hg ci -qAm z
274 276 transaction abort!
275 277 rollback completed
276 278 abort: forced transaction failure
277 279 [255]
278 280 $ cat .hg/store/fncache
279 281 data/y.i
280 282
281 283 Aborted transactions can be recovered later
282 284
283 285 $ cat > ../exceptionext.py <<EOF
284 286 > import os
285 287 > from mercurial import commands, error, transaction, localrepo
286 288 > from mercurial.extensions import wrapfunction
287 289 >
288 290 > def trwrapper(orig, self, *args, **kwargs):
289 291 > tr = orig(self, *args, **kwargs)
290 292 > def fail(tr):
291 293 > raise error.Abort("forced transaction failure")
292 294 > # zzz prefix to ensure it sorted after store.write
293 295 > tr.addfinalize('zzz-forcefails', fail)
294 296 > return tr
295 297 >
296 298 > def abortwrapper(orig, self, *args, **kwargs):
297 299 > raise error.Abort("forced transaction failure")
298 300 >
299 301 > def uisetup(ui):
300 302 > wrapfunction(localrepo.localrepository, 'transaction', trwrapper)
301 303 > wrapfunction(transaction.transaction, '_abort', abortwrapper)
302 304 >
303 305 > cmdtable = {}
304 306 >
305 307 > EOF
306 308 $ rm -f "${extpath}c"
307 309 $ hg up -q 1
308 310 $ touch z
309 311 $ hg ci -qAm z 2>/dev/null
310 312 [255]
311 313 $ cat .hg/store/fncache | sort
312 314 data/y.i
313 315 data/z.i
314 316 $ hg recover
315 317 rolling back interrupted transaction
316 318 checking changesets
317 319 checking manifests
318 320 crosschecking files in changesets and manifests
319 321 checking files
320 322 1 files, 1 changesets, 1 total revisions
321 323 $ cat .hg/store/fncache
322 324 data/y.i
323 325
324 326 $ cd ..
325 327
326 328 debugrebuildfncache does nothing unless repo has fncache requirement
327 329
328 330 $ hg --config format.usefncache=false init nofncache
329 331 $ cd nofncache
330 332 $ hg debugrebuildfncache
331 333 (not rebuilding fncache because repository does not support fncache)
332 334
333 335 $ cd ..
334 336
335 337 debugrebuildfncache works on empty repository
336 338
337 339 $ hg init empty
338 340 $ cd empty
339 341 $ hg debugrebuildfncache
340 342 fncache already up to date
341 343 $ cd ..
342 344
343 345 debugrebuildfncache on an up to date repository no-ops
344 346
345 347 $ hg init repo
346 348 $ cd repo
347 349 $ echo initial > foo
348 350 $ echo initial > .bar
349 351 $ hg commit -A -m initial
350 352 adding .bar
351 353 adding foo
352 354
353 355 $ cat .hg/store/fncache | sort
354 356 data/.bar.i
355 357 data/foo.i
356 358
357 359 $ hg debugrebuildfncache
358 360 fncache already up to date
359 361
360 362 debugrebuildfncache restores deleted fncache file
361 363
362 364 $ rm -f .hg/store/fncache
363 365 $ hg debugrebuildfncache
364 366 adding data/.bar.i
365 367 adding data/foo.i
366 368 2 items added, 0 removed from fncache
367 369
368 370 $ cat .hg/store/fncache | sort
369 371 data/.bar.i
370 372 data/foo.i
371 373
372 374 Rebuild after rebuild should no-op
373 375
374 376 $ hg debugrebuildfncache
375 377 fncache already up to date
376 378
377 379 A single missing file should get restored, an extra file should be removed
378 380
379 381 $ cat > .hg/store/fncache << EOF
380 382 > data/foo.i
381 383 > data/bad-entry.i
382 384 > EOF
383 385
384 386 $ hg debugrebuildfncache
385 387 removing data/bad-entry.i
386 388 adding data/.bar.i
387 389 1 items added, 1 removed from fncache
388 390
389 391 $ cat .hg/store/fncache | sort
390 392 data/.bar.i
391 393 data/foo.i
392 394
393 395 $ cd ..
394 396
395 397 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
396 398
397 399 $ hg --config format.dotencode=false init nodotencode
398 400 $ cd nodotencode
399 401 $ echo initial > foo
400 402 $ echo initial > .bar
401 403 $ hg commit -A -m initial
402 404 adding .bar
403 405 adding foo
404 406
405 407 $ cat .hg/store/fncache | sort
406 408 data/.bar.i
407 409 data/foo.i
408 410
409 411 $ rm .hg/store/fncache
410 412 $ hg debugrebuildfncache
411 413 adding data/.bar.i
412 414 adding data/foo.i
413 415 2 items added, 0 removed from fncache
414 416
415 417 $ cat .hg/store/fncache | sort
416 418 data/.bar.i
417 419 data/foo.i
@@ -1,424 +1,426 b''
1 1 #require hardlink
2 2
3 3 $ cat > nlinks.py <<EOF
4 4 > import sys
5 5 > from mercurial import util
6 6 > for f in sorted(sys.stdin.readlines()):
7 7 > f = f[:-1]
8 8 > print util.nlinks(f), f
9 9 > EOF
10 10
11 11 $ nlinksdir()
12 12 > {
13 13 > find "$@" -type f | $PYTHON $TESTTMP/nlinks.py
14 14 > }
15 15
16 16 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
17 17
18 18 $ cat > linkcp.py <<EOF
19 19 > from mercurial import util
20 20 > import sys
21 21 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
22 22 > EOF
23 23
24 24 $ linkcp()
25 25 > {
26 26 > $PYTHON $TESTTMP/linkcp.py $1 $2
27 27 > }
28 28
29 29 Prepare repo r1:
30 30
31 31 $ hg init r1
32 32 $ cd r1
33 33
34 34 $ echo c1 > f1
35 35 $ hg add f1
36 36 $ hg ci -m0
37 37
38 38 $ mkdir d1
39 39 $ cd d1
40 40 $ echo c2 > f2
41 41 $ hg add f2
42 42 $ hg ci -m1
43 43 $ cd ../..
44 44
45 45 $ nlinksdir r1/.hg/store
46 46 1 r1/.hg/store/00changelog.i
47 47 1 r1/.hg/store/00manifest.i
48 48 1 r1/.hg/store/data/d1/f2.i
49 49 1 r1/.hg/store/data/f1.i
50 50 1 r1/.hg/store/fncache
51 51 1 r1/.hg/store/phaseroots
52 52 1 r1/.hg/store/undo
53 53 1 r1/.hg/store/undo.backup.fncache
54 54 1 r1/.hg/store/undo.backupfiles
55 55 1 r1/.hg/store/undo.phaseroots
56 56
57 57
58 58 Create hardlinked clone r2:
59 59
60 60 $ hg clone -U --debug r1 r2 --config progress.debug=true
61 61 linking: 1
62 62 linking: 2
63 63 linking: 3
64 64 linking: 4
65 65 linking: 5
66 66 linking: 6
67 67 linking: 7
68 68 linked 7 files
69 69
70 70 Create non-hardlinked clone r3:
71 71
72 72 $ hg clone --pull r1 r3
73 73 requesting all changes
74 74 adding changesets
75 75 adding manifests
76 76 adding file changes
77 77 added 2 changesets with 2 changes to 2 files
78 78 updating to branch default
79 79 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 80
81 81
82 82 Repos r1 and r2 should now contain hardlinked files:
83 83
84 84 $ nlinksdir r1/.hg/store
85 85 2 r1/.hg/store/00changelog.i
86 86 2 r1/.hg/store/00manifest.i
87 87 2 r1/.hg/store/data/d1/f2.i
88 88 2 r1/.hg/store/data/f1.i
89 89 2 r1/.hg/store/fncache
90 90 1 r1/.hg/store/phaseroots
91 91 1 r1/.hg/store/undo
92 92 1 r1/.hg/store/undo.backup.fncache
93 93 1 r1/.hg/store/undo.backupfiles
94 94 1 r1/.hg/store/undo.phaseroots
95 95
96 96 $ nlinksdir r2/.hg/store
97 97 2 r2/.hg/store/00changelog.i
98 98 2 r2/.hg/store/00manifest.i
99 99 2 r2/.hg/store/data/d1/f2.i
100 100 2 r2/.hg/store/data/f1.i
101 101 2 r2/.hg/store/fncache
102 102
103 103 Repo r3 should not be hardlinked:
104 104
105 105 $ nlinksdir r3/.hg/store
106 106 1 r3/.hg/store/00changelog.i
107 107 1 r3/.hg/store/00manifest.i
108 108 1 r3/.hg/store/data/d1/f2.i
109 109 1 r3/.hg/store/data/f1.i
110 110 1 r3/.hg/store/fncache
111 111 1 r3/.hg/store/phaseroots
112 112 1 r3/.hg/store/undo
113 113 1 r3/.hg/store/undo.backupfiles
114 114 1 r3/.hg/store/undo.phaseroots
115 115
116 116
117 117 Create a non-inlined filelog in r3:
118 118
119 119 $ cd r3/d1
120 120 >>> f = open('data1', 'wb')
121 121 >>> for x in range(10000):
122 122 ... f.write("%s\n" % str(x))
123 123 >>> f.close()
124 124 $ for j in 0 1 2 3 4 5 6 7 8 9; do
125 125 > cat data1 >> f2
126 126 > hg commit -m$j
127 127 > done
128 128 $ cd ../..
129 129
130 130 $ nlinksdir r3/.hg/store
131 131 1 r3/.hg/store/00changelog.i
132 132 1 r3/.hg/store/00manifest.i
133 133 1 r3/.hg/store/data/d1/f2.d
134 134 1 r3/.hg/store/data/d1/f2.i
135 135 1 r3/.hg/store/data/f1.i
136 136 1 r3/.hg/store/fncache
137 137 1 r3/.hg/store/phaseroots
138 138 1 r3/.hg/store/undo
139 139 1 r3/.hg/store/undo.backup.fncache
140 140 1 r3/.hg/store/undo.backup.phaseroots
141 141 1 r3/.hg/store/undo.backupfiles
142 142 1 r3/.hg/store/undo.phaseroots
143 143
144 144 Push to repo r1 should break up most hardlinks in r2:
145 145
146 146 $ hg -R r2 verify
147 147 checking changesets
148 148 checking manifests
149 149 crosschecking files in changesets and manifests
150 150 checking files
151 151 2 files, 2 changesets, 2 total revisions
152 152
153 153 $ cd r3
154 154 $ hg push
155 155 pushing to $TESTTMP/r1 (glob)
156 156 searching for changes
157 157 adding changesets
158 158 adding manifests
159 159 adding file changes
160 160 added 10 changesets with 10 changes to 1 files
161 161
162 162 $ cd ..
163 163
164 164 $ nlinksdir r2/.hg/store
165 165 1 r2/.hg/store/00changelog.i
166 166 1 r2/.hg/store/00manifest.i
167 167 1 r2/.hg/store/data/d1/f2.i
168 168 2 r2/.hg/store/data/f1.i
169 169 [12] r2/\.hg/store/fncache (re)
170 170
171 171 #if hardlink-whitelisted
172 172 $ nlinksdir r2/.hg/store/fncache
173 173 2 r2/.hg/store/fncache
174 174 #endif
175 175
176 176 $ hg -R r2 verify
177 177 checking changesets
178 178 checking manifests
179 179 crosschecking files in changesets and manifests
180 180 checking files
181 181 2 files, 2 changesets, 2 total revisions
182 182
183 183
184 184 $ cd r1
185 185 $ hg up
186 186 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
187 187
188 188 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
189 189
190 190 $ echo c1c1 >> f1
191 191 $ hg ci -m00
192 192 $ cd ..
193 193
194 194 $ nlinksdir r2/.hg/store
195 195 1 r2/.hg/store/00changelog.i
196 196 1 r2/.hg/store/00manifest.i
197 197 1 r2/.hg/store/data/d1/f2.i
198 198 1 r2/.hg/store/data/f1.i
199 199 [12] r2/\.hg/store/fncache (re)
200 200
201 201 #if hardlink-whitelisted
202 202 $ nlinksdir r2/.hg/store/fncache
203 203 2 r2/.hg/store/fncache
204 204 #endif
205 205
206 206 Create a file which exec permissions we will change
207 207 $ cd r3
208 208 $ echo "echo hello world" > f3
209 209 $ hg add f3
210 210 $ hg ci -mf3
211 211 $ cd ..
212 212
213 213 $ cd r3
214 214 $ hg tip --template '{rev}:{node|short}\n'
215 215 12:d3b77733a28a
216 216 $ echo bla > f1
217 217 $ chmod +x f3
218 218 $ hg ci -m1
219 219 $ cd ..
220 220
221 221 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
222 222
223 223 $ linkcp r3 r4
224 224
225 225 'checklink' is produced by hardlinking a symlink, which is undefined whether
226 226 the symlink should be followed or not. It does behave differently on Linux and
227 227 BSD. Just remove it so the test pass on both platforms.
228 228
229 229 $ rm -f r4/.hg/cache/checklink
230 230
231 231 r4 has hardlinks in the working dir (not just inside .hg):
232 232
233 233 $ nlinksdir r4
234 234 2 r4/.hg/00changelog.i
235 235 2 r4/.hg/branch
236 236 2 r4/.hg/cache/branch2-base
237 237 2 r4/.hg/cache/branch2-served
238 238 2 r4/.hg/cache/checkisexec (execbit !)
239 239 ? r4/.hg/cache/checklink-target (glob) (symlink !)
240 240 2 r4/.hg/cache/checknoexec (execbit !)
241 241 2 r4/.hg/cache/rbc-names-v1
242 242 2 r4/.hg/cache/rbc-revs-v1
243 243 2 r4/.hg/dirstate
244 2 r4/.hg/fsmonitor.state (fsmonitor !)
244 245 2 r4/.hg/hgrc
245 246 2 r4/.hg/last-message.txt
246 247 2 r4/.hg/requires
247 248 2 r4/.hg/store/00changelog.i
248 249 2 r4/.hg/store/00manifest.i
249 250 2 r4/.hg/store/data/d1/f2.d
250 251 2 r4/.hg/store/data/d1/f2.i
251 252 2 r4/.hg/store/data/f1.i
252 253 2 r4/.hg/store/data/f3.i
253 254 2 r4/.hg/store/fncache
254 255 2 r4/.hg/store/phaseroots
255 256 2 r4/.hg/store/undo
256 257 2 r4/.hg/store/undo.backup.fncache
257 258 2 r4/.hg/store/undo.backup.phaseroots
258 259 2 r4/.hg/store/undo.backupfiles
259 260 2 r4/.hg/store/undo.phaseroots
260 261 [24] r4/\.hg/undo\.backup\.dirstate (re)
261 262 2 r4/.hg/undo.bookmarks
262 263 2 r4/.hg/undo.branch
263 264 2 r4/.hg/undo.desc
264 265 [24] r4/\.hg/undo\.dirstate (re)
265 266 2 r4/d1/data1
266 267 2 r4/d1/f2
267 268 2 r4/f1
268 269 2 r4/f3
269 270
270 271 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
271 272 #if hardlink-whitelisted
272 273 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
273 274 4 r4/.hg/undo.backup.dirstate
274 275 4 r4/.hg/undo.dirstate
275 276 #endif
276 277
277 278
278 279 $ hg -R r4 up 12
279 280 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
280 281 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
281 282
282 283 $ nlinksdir r4
283 284 2 r4/.hg/00changelog.i
284 285 1 r4/.hg/branch
285 286 2 r4/.hg/cache/branch2-base
286 287 2 r4/.hg/cache/branch2-served
287 288 2 r4/.hg/cache/checkisexec (execbit !)
288 289 2 r4/.hg/cache/checklink-target (symlink !)
289 290 2 r4/.hg/cache/checknoexec (execbit !)
290 291 2 r4/.hg/cache/rbc-names-v1
291 292 2 r4/.hg/cache/rbc-revs-v1
292 293 1 r4/.hg/dirstate
294 1 r4/.hg/fsmonitor.state (fsmonitor !)
293 295 2 r4/.hg/hgrc
294 296 2 r4/.hg/last-message.txt
295 297 2 r4/.hg/requires
296 298 2 r4/.hg/store/00changelog.i
297 299 2 r4/.hg/store/00manifest.i
298 300 2 r4/.hg/store/data/d1/f2.d
299 301 2 r4/.hg/store/data/d1/f2.i
300 302 2 r4/.hg/store/data/f1.i
301 303 2 r4/.hg/store/data/f3.i
302 304 2 r4/.hg/store/fncache
303 305 2 r4/.hg/store/phaseroots
304 306 2 r4/.hg/store/undo
305 307 2 r4/.hg/store/undo.backup.fncache
306 308 2 r4/.hg/store/undo.backup.phaseroots
307 309 2 r4/.hg/store/undo.backupfiles
308 310 2 r4/.hg/store/undo.phaseroots
309 311 [24] r4/\.hg/undo\.backup\.dirstate (re)
310 312 2 r4/.hg/undo.bookmarks
311 313 2 r4/.hg/undo.branch
312 314 2 r4/.hg/undo.desc
313 315 [24] r4/\.hg/undo\.dirstate (re)
314 316 2 r4/d1/data1
315 317 2 r4/d1/f2
316 318 1 r4/f1
317 319 1 r4/f3 (execbit !)
318 320 2 r4/f3 (no-execbit !)
319 321
320 322 #if hardlink-whitelisted
321 323 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
322 324 4 r4/.hg/undo.backup.dirstate
323 325 4 r4/.hg/undo.dirstate
324 326 #endif
325 327
326 328 Test hardlinking outside hg:
327 329
328 330 $ mkdir x
329 331 $ echo foo > x/a
330 332
331 333 $ linkcp x y
332 334 $ echo bar >> y/a
333 335
334 336 No diff if hardlink:
335 337
336 338 $ diff x/a y/a
337 339
338 340 Test mq hardlinking:
339 341
340 342 $ echo "[extensions]" >> $HGRCPATH
341 343 $ echo "mq=" >> $HGRCPATH
342 344
343 345 $ hg init a
344 346 $ cd a
345 347
346 348 $ hg qimport -n foo - << EOF
347 349 > # HG changeset patch
348 350 > # Date 1 0
349 351 > diff -r 2588a8b53d66 a
350 352 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
351 353 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
352 354 > @@ -0,0 +1,1 @@
353 355 > +a
354 356 > EOF
355 357 adding foo to series file
356 358
357 359 $ hg qpush
358 360 applying foo
359 361 now at: foo
360 362
361 363 $ cd ..
362 364 $ linkcp a b
363 365 $ cd b
364 366
365 367 $ hg qimport -n bar - << EOF
366 368 > # HG changeset patch
367 369 > # Date 2 0
368 370 > diff -r 2588a8b53d66 a
369 371 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
370 372 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
371 373 > @@ -0,0 +1,1 @@
372 374 > +b
373 375 > EOF
374 376 adding bar to series file
375 377
376 378 $ hg qpush
377 379 applying bar
378 380 now at: bar
379 381
380 382 $ cat .hg/patches/status
381 383 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
382 384 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
383 385
384 386 $ cat .hg/patches/series
385 387 foo
386 388 bar
387 389
388 390 $ cat ../a/.hg/patches/status
389 391 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
390 392
391 393 $ cat ../a/.hg/patches/series
392 394 foo
393 395
394 396 Test tags hardlinking:
395 397
396 398 $ hg qdel -r qbase:qtip
397 399 patch foo finalized without changeset message
398 400 patch bar finalized without changeset message
399 401
400 402 $ hg tag -l lfoo
401 403 $ hg tag foo
402 404
403 405 $ cd ..
404 406 $ linkcp b c
405 407 $ cd c
406 408
407 409 $ hg tag -l -r 0 lbar
408 410 $ hg tag -r 0 bar
409 411
410 412 $ cat .hgtags
411 413 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
412 414 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
413 415
414 416 $ cat .hg/localtags
415 417 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
416 418 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
417 419
418 420 $ cat ../b/.hgtags
419 421 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
420 422
421 423 $ cat ../b/.hg/localtags
422 424 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
423 425
424 426 $ cd ..
@@ -1,156 +1,157 b''
1 1 #require unix-permissions
2 2
3 3 test that new files created in .hg inherit the permissions from .hg/store
4 4
5 5 $ mkdir dir
6 6
7 7 just in case somebody has a strange $TMPDIR
8 8
9 9 $ chmod g-s dir
10 10 $ cd dir
11 11
12 12 $ cat >printmodes.py <<EOF
13 13 > import os, sys
14 14 >
15 15 > allnames = []
16 16 > isdir = {}
17 17 > for root, dirs, files in os.walk(sys.argv[1]):
18 18 > for d in dirs:
19 19 > name = os.path.join(root, d)
20 20 > isdir[name] = 1
21 21 > allnames.append(name)
22 22 > for f in files:
23 23 > name = os.path.join(root, f)
24 24 > allnames.append(name)
25 25 > allnames.sort()
26 26 > for name in allnames:
27 27 > suffix = name in isdir and '/' or ''
28 28 > print '%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix)
29 29 > EOF
30 30
31 31 $ cat >mode.py <<EOF
32 32 > import sys
33 33 > import os
34 34 > print '%05o' % os.lstat(sys.argv[1]).st_mode
35 35 > EOF
36 36
37 37 $ umask 077
38 38
39 39 $ hg init repo
40 40 $ cd repo
41 41
42 42 $ chmod 0770 .hg/store
43 43
44 44 before commit
45 45 store can be written by the group, other files cannot
46 46 store is setgid
47 47
48 48 $ $PYTHON ../printmodes.py .
49 49 00700 ./.hg/
50 50 00600 ./.hg/00changelog.i
51 51 00600 ./.hg/requires
52 52 00770 ./.hg/store/
53 53
54 54 $ mkdir dir
55 55 $ touch foo dir/bar
56 56 $ hg ci -qAm 'add files'
57 57
58 58 after commit
59 59 working dir files can only be written by the owner
60 60 files created in .hg can be written by the group
61 61 (in particular, store/**, dirstate, branch cache file, undo files)
62 62 new directories are setgid
63 63
64 64 $ $PYTHON ../printmodes.py .
65 65 00700 ./.hg/
66 66 00600 ./.hg/00changelog.i
67 67 00770 ./.hg/cache/
68 68 00660 ./.hg/cache/branch2-served
69 69 00660 ./.hg/cache/rbc-names-v1
70 70 00660 ./.hg/cache/rbc-revs-v1
71 71 00660 ./.hg/dirstate
72 00660 ./.hg/fsmonitor.state (fsmonitor !)
72 73 00660 ./.hg/last-message.txt
73 74 00600 ./.hg/requires
74 75 00770 ./.hg/store/
75 76 00660 ./.hg/store/00changelog.i
76 77 00660 ./.hg/store/00manifest.i
77 78 00770 ./.hg/store/data/
78 79 00770 ./.hg/store/data/dir/
79 80 00660 ./.hg/store/data/dir/bar.i
80 81 00660 ./.hg/store/data/foo.i
81 82 00660 ./.hg/store/fncache
82 83 00660 ./.hg/store/phaseroots
83 84 00660 ./.hg/store/undo
84 85 00660 ./.hg/store/undo.backupfiles
85 86 00660 ./.hg/store/undo.phaseroots
86 87 00660 ./.hg/undo.backup.dirstate
87 88 00660 ./.hg/undo.bookmarks
88 89 00660 ./.hg/undo.branch
89 90 00660 ./.hg/undo.desc
90 91 00660 ./.hg/undo.dirstate
91 92 00700 ./dir/
92 93 00600 ./dir/bar
93 94 00600 ./foo
94 95
95 96 $ umask 007
96 97 $ hg init ../push
97 98
98 99 before push
99 100 group can write everything
100 101
101 102 $ $PYTHON ../printmodes.py ../push
102 103 00770 ../push/.hg/
103 104 00660 ../push/.hg/00changelog.i
104 105 00660 ../push/.hg/requires
105 106 00770 ../push/.hg/store/
106 107
107 108 $ umask 077
108 109 $ hg -q push ../push
109 110
110 111 after push
111 112 group can still write everything
112 113
113 114 $ $PYTHON ../printmodes.py ../push
114 115 00770 ../push/.hg/
115 116 00660 ../push/.hg/00changelog.i
116 117 00770 ../push/.hg/cache/
117 118 00660 ../push/.hg/cache/branch2-base
118 119 00660 ../push/.hg/dirstate
119 120 00660 ../push/.hg/requires
120 121 00770 ../push/.hg/store/
121 122 00660 ../push/.hg/store/00changelog.i
122 123 00660 ../push/.hg/store/00manifest.i
123 124 00770 ../push/.hg/store/data/
124 125 00770 ../push/.hg/store/data/dir/
125 126 00660 ../push/.hg/store/data/dir/bar.i
126 127 00660 ../push/.hg/store/data/foo.i
127 128 00660 ../push/.hg/store/fncache
128 129 00660 ../push/.hg/store/undo
129 130 00660 ../push/.hg/store/undo.backupfiles
130 131 00660 ../push/.hg/store/undo.phaseroots
131 132 00660 ../push/.hg/undo.bookmarks
132 133 00660 ../push/.hg/undo.branch
133 134 00660 ../push/.hg/undo.desc
134 135 00660 ../push/.hg/undo.dirstate
135 136
136 137
137 138 Test that we don't lose the setgid bit when we call chmod.
138 139 Not all systems support setgid directories (e.g. HFS+), so
139 140 just check that directories have the same mode.
140 141
141 142 $ cd ..
142 143 $ hg init setgid
143 144 $ cd setgid
144 145 $ chmod g+rwx .hg/store
145 146 $ chmod g+s .hg/store 2> /dev/null || true
146 147 $ mkdir dir
147 148 $ touch dir/file
148 149 $ hg ci -qAm 'add dir/file'
149 150 $ storemode=`$PYTHON ../mode.py .hg/store`
150 151 $ dirmode=`$PYTHON ../mode.py .hg/store/data/dir`
151 152 $ if [ "$storemode" != "$dirmode" ]; then
152 153 > echo "$storemode != $dirmode"
153 154 > fi
154 155 $ cd ..
155 156
156 157 $ cd .. # g-s dir
General Comments 0
You need to be logged in to leave comments. Login now