##// END OF EJS Templates
test-fncache: ensure lock doesn't look held to __del__...
Augie Fackler -
r27168:8a829fc8 default
parent child Browse files
Show More
@@ -1,400 +1,401
1 Init repo1:
1 Init repo1:
2
2
3 $ hg init repo1
3 $ hg init repo1
4 $ cd repo1
4 $ cd repo1
5 $ echo "some text" > a
5 $ echo "some text" > a
6 $ hg add
6 $ hg add
7 adding a
7 adding a
8 $ hg ci -m first
8 $ hg ci -m first
9 $ cat .hg/store/fncache | sort
9 $ cat .hg/store/fncache | sort
10 data/a.i
10 data/a.i
11
11
12 Testing a.i/b:
12 Testing a.i/b:
13
13
14 $ mkdir a.i
14 $ mkdir a.i
15 $ echo "some other text" > a.i/b
15 $ echo "some other text" > a.i/b
16 $ hg add
16 $ hg add
17 adding a.i/b (glob)
17 adding a.i/b (glob)
18 $ hg ci -m second
18 $ hg ci -m second
19 $ cat .hg/store/fncache | sort
19 $ cat .hg/store/fncache | sort
20 data/a.i
20 data/a.i
21 data/a.i.hg/b.i
21 data/a.i.hg/b.i
22
22
23 Testing a.i.hg/c:
23 Testing a.i.hg/c:
24
24
25 $ mkdir a.i.hg
25 $ mkdir a.i.hg
26 $ echo "yet another text" > a.i.hg/c
26 $ echo "yet another text" > a.i.hg/c
27 $ hg add
27 $ hg add
28 adding a.i.hg/c (glob)
28 adding a.i.hg/c (glob)
29 $ hg ci -m third
29 $ hg ci -m third
30 $ cat .hg/store/fncache | sort
30 $ cat .hg/store/fncache | sort
31 data/a.i
31 data/a.i
32 data/a.i.hg.hg/c.i
32 data/a.i.hg.hg/c.i
33 data/a.i.hg/b.i
33 data/a.i.hg/b.i
34
34
35 Testing verify:
35 Testing verify:
36
36
37 $ hg verify
37 $ hg verify
38 checking changesets
38 checking changesets
39 checking manifests
39 checking manifests
40 crosschecking files in changesets and manifests
40 crosschecking files in changesets and manifests
41 checking files
41 checking files
42 3 files, 3 changesets, 3 total revisions
42 3 files, 3 changesets, 3 total revisions
43
43
44 $ rm .hg/store/fncache
44 $ rm .hg/store/fncache
45
45
46 $ hg verify
46 $ hg verify
47 checking changesets
47 checking changesets
48 checking manifests
48 checking manifests
49 crosschecking files in changesets and manifests
49 crosschecking files in changesets and manifests
50 checking files
50 checking files
51 warning: revlog 'data/a.i' not in fncache!
51 warning: revlog 'data/a.i' not in fncache!
52 warning: revlog 'data/a.i.hg/c.i' not in fncache!
52 warning: revlog 'data/a.i.hg/c.i' not in fncache!
53 warning: revlog 'data/a.i/b.i' not in fncache!
53 warning: revlog 'data/a.i/b.i' not in fncache!
54 3 files, 3 changesets, 3 total revisions
54 3 files, 3 changesets, 3 total revisions
55 3 warnings encountered!
55 3 warnings encountered!
56 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
56 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
57
57
58 Follow the hint to make sure it works
58 Follow the hint to make sure it works
59
59
60 $ hg debugrebuildfncache
60 $ hg debugrebuildfncache
61 adding data/a.i
61 adding data/a.i
62 adding data/a.i.hg/c.i
62 adding data/a.i.hg/c.i
63 adding data/a.i/b.i
63 adding data/a.i/b.i
64 3 items added, 0 removed from fncache
64 3 items added, 0 removed from fncache
65
65
66 $ hg verify
66 $ hg verify
67 checking changesets
67 checking changesets
68 checking manifests
68 checking manifests
69 crosschecking files in changesets and manifests
69 crosschecking files in changesets and manifests
70 checking files
70 checking files
71 3 files, 3 changesets, 3 total revisions
71 3 files, 3 changesets, 3 total revisions
72
72
73 $ cd ..
73 $ cd ..
74
74
75 Non store repo:
75 Non store repo:
76
76
77 $ hg --config format.usestore=False init foo
77 $ hg --config format.usestore=False init foo
78 $ cd foo
78 $ cd foo
79 $ mkdir tst.d
79 $ mkdir tst.d
80 $ echo foo > tst.d/foo
80 $ echo foo > tst.d/foo
81 $ hg ci -Amfoo
81 $ hg ci -Amfoo
82 adding tst.d/foo
82 adding tst.d/foo
83 $ find .hg | sort
83 $ find .hg | sort
84 .hg
84 .hg
85 .hg/00changelog.i
85 .hg/00changelog.i
86 .hg/00manifest.i
86 .hg/00manifest.i
87 .hg/cache
87 .hg/cache
88 .hg/cache/branch2-served
88 .hg/cache/branch2-served
89 .hg/cache/rbc-names-v1
89 .hg/cache/rbc-names-v1
90 .hg/cache/rbc-revs-v1
90 .hg/cache/rbc-revs-v1
91 .hg/data
91 .hg/data
92 .hg/data/tst.d.hg
92 .hg/data/tst.d.hg
93 .hg/data/tst.d.hg/foo.i
93 .hg/data/tst.d.hg/foo.i
94 .hg/dirstate
94 .hg/dirstate
95 .hg/last-message.txt
95 .hg/last-message.txt
96 .hg/phaseroots
96 .hg/phaseroots
97 .hg/requires
97 .hg/requires
98 .hg/undo
98 .hg/undo
99 .hg/undo.backup.dirstate
99 .hg/undo.backup.dirstate
100 .hg/undo.backupfiles
100 .hg/undo.backupfiles
101 .hg/undo.bookmarks
101 .hg/undo.bookmarks
102 .hg/undo.branch
102 .hg/undo.branch
103 .hg/undo.desc
103 .hg/undo.desc
104 .hg/undo.dirstate
104 .hg/undo.dirstate
105 .hg/undo.phaseroots
105 .hg/undo.phaseroots
106 $ cd ..
106 $ cd ..
107
107
108 Non fncache repo:
108 Non fncache repo:
109
109
110 $ hg --config format.usefncache=False init bar
110 $ hg --config format.usefncache=False init bar
111 $ cd bar
111 $ cd bar
112 $ mkdir tst.d
112 $ mkdir tst.d
113 $ echo foo > tst.d/Foo
113 $ echo foo > tst.d/Foo
114 $ hg ci -Amfoo
114 $ hg ci -Amfoo
115 adding tst.d/Foo
115 adding tst.d/Foo
116 $ find .hg | sort
116 $ find .hg | sort
117 .hg
117 .hg
118 .hg/00changelog.i
118 .hg/00changelog.i
119 .hg/cache
119 .hg/cache
120 .hg/cache/branch2-served
120 .hg/cache/branch2-served
121 .hg/cache/rbc-names-v1
121 .hg/cache/rbc-names-v1
122 .hg/cache/rbc-revs-v1
122 .hg/cache/rbc-revs-v1
123 .hg/dirstate
123 .hg/dirstate
124 .hg/last-message.txt
124 .hg/last-message.txt
125 .hg/requires
125 .hg/requires
126 .hg/store
126 .hg/store
127 .hg/store/00changelog.i
127 .hg/store/00changelog.i
128 .hg/store/00manifest.i
128 .hg/store/00manifest.i
129 .hg/store/data
129 .hg/store/data
130 .hg/store/data/tst.d.hg
130 .hg/store/data/tst.d.hg
131 .hg/store/data/tst.d.hg/_foo.i
131 .hg/store/data/tst.d.hg/_foo.i
132 .hg/store/phaseroots
132 .hg/store/phaseroots
133 .hg/store/undo
133 .hg/store/undo
134 .hg/store/undo.backupfiles
134 .hg/store/undo.backupfiles
135 .hg/store/undo.phaseroots
135 .hg/store/undo.phaseroots
136 .hg/undo.backup.dirstate
136 .hg/undo.backup.dirstate
137 .hg/undo.bookmarks
137 .hg/undo.bookmarks
138 .hg/undo.branch
138 .hg/undo.branch
139 .hg/undo.desc
139 .hg/undo.desc
140 .hg/undo.dirstate
140 .hg/undo.dirstate
141 $ cd ..
141 $ cd ..
142
142
143 Encoding of reserved / long paths in the store
143 Encoding of reserved / long paths in the store
144
144
145 $ hg init r2
145 $ hg init r2
146 $ cd r2
146 $ cd r2
147 $ cat <<EOF > .hg/hgrc
147 $ cat <<EOF > .hg/hgrc
148 > [ui]
148 > [ui]
149 > portablefilenames = ignore
149 > portablefilenames = ignore
150 > EOF
150 > EOF
151
151
152 $ hg import -q --bypass - <<EOF
152 $ hg import -q --bypass - <<EOF
153 > # HG changeset patch
153 > # HG changeset patch
154 > # User test
154 > # User test
155 > # Date 0 0
155 > # Date 0 0
156 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
156 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
157 > # Parent 0000000000000000000000000000000000000000
157 > # Parent 0000000000000000000000000000000000000000
158 > 1
158 > 1
159 >
159 >
160 > 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
160 > 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 > new file mode 100644
161 > new file mode 100644
162 > --- /dev/null
162 > --- /dev/null
163 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
163 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
164 > @@ -0,0 +1,1 @@
164 > @@ -0,0 +1,1 @@
165 > +foo
165 > +foo
166 > 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
166 > 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 > new file mode 100644
167 > new file mode 100644
168 > --- /dev/null
168 > --- /dev/null
169 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
169 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
170 > @@ -0,0 +1,1 @@
170 > @@ -0,0 +1,1 @@
171 > +foo
171 > +foo
172 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
172 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
173 > new file mode 100644
173 > new file mode 100644
174 > --- /dev/null
174 > --- /dev/null
175 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
175 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
176 > @@ -0,0 +1,1 @@
176 > @@ -0,0 +1,1 @@
177 > +foo
177 > +foo
178 > 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
178 > 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 > new file mode 100644
179 > new file mode 100644
180 > --- /dev/null
180 > --- /dev/null
181 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
181 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
182 > @@ -0,0 +1,1 @@
182 > @@ -0,0 +1,1 @@
183 > +foo
183 > +foo
184 > 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
184 > 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 > new file mode 100644
185 > new file mode 100644
186 > --- /dev/null
186 > --- /dev/null
187 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
187 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
188 > @@ -0,0 +1,1 @@
188 > @@ -0,0 +1,1 @@
189 > +foo
189 > +foo
190 > EOF
190 > EOF
191
191
192 $ find .hg/store -name *.i | sort
192 $ find .hg/store -name *.i | sort
193 .hg/store/00changelog.i
193 .hg/store/00changelog.i
194 .hg/store/00manifest.i
194 .hg/store/00manifest.i
195 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
195 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
196 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
196 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
197 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
197 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
198 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
198 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
199 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
199 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
200
200
201 $ cd ..
201 $ cd ..
202
202
203 Aborting lock does not prevent fncache writes
203 Aborting lock does not prevent fncache writes
204
204
205 $ cat > exceptionext.py <<EOF
205 $ cat > exceptionext.py <<EOF
206 > import os
206 > import os
207 > from mercurial import commands, error
207 > from mercurial import commands, error
208 > from mercurial.extensions import wrapfunction
208 > from mercurial.extensions import wrapfunction
209 >
209 >
210 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
210 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
211 > def releasewrap():
211 > def releasewrap():
212 > l.held = False # ensure __del__ is a noop
212 > raise error.Abort("forced lock failure")
213 > raise error.Abort("forced lock failure")
213 > return orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
214 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
215 > return l
214 >
216 >
215 > def reposetup(ui, repo):
217 > def reposetup(ui, repo):
216 > wrapfunction(repo, '_lock', lockexception)
218 > wrapfunction(repo, '_lock', lockexception)
217 >
219 >
218 > cmdtable = {}
220 > cmdtable = {}
219 >
221 >
220 > EOF
222 > EOF
221 $ extpath=`pwd`/exceptionext.py
223 $ extpath=`pwd`/exceptionext.py
222 $ hg init fncachetxn
224 $ hg init fncachetxn
223 $ cd fncachetxn
225 $ cd fncachetxn
224 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
226 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
225 $ touch y
227 $ touch y
226 $ hg ci -qAm y
228 $ hg ci -qAm y
227 abort: forced lock failure
229 abort: forced lock failure
228 Exception mercurial.error.Abort: Abort('forced lock failure',) in <bound method lock.__del__ of <mercurial.lock.lock object at *>> ignored (glob)
229 [255]
230 [255]
230 $ cat .hg/store/fncache
231 $ cat .hg/store/fncache
231 data/y.i
232 data/y.i
232
233
233 Aborting transaction prevents fncache change
234 Aborting transaction prevents fncache change
234
235
235 $ cat > ../exceptionext.py <<EOF
236 $ cat > ../exceptionext.py <<EOF
236 > import os
237 > import os
237 > from mercurial import commands, error, localrepo
238 > from mercurial import commands, error, localrepo
238 > from mercurial.extensions import wrapfunction
239 > from mercurial.extensions import wrapfunction
239 >
240 >
240 > def wrapper(orig, self, *args, **kwargs):
241 > def wrapper(orig, self, *args, **kwargs):
241 > tr = orig(self, *args, **kwargs)
242 > tr = orig(self, *args, **kwargs)
242 > def fail(tr):
243 > def fail(tr):
243 > raise error.Abort("forced transaction failure")
244 > raise error.Abort("forced transaction failure")
244 > # zzz prefix to ensure it sorted after store.write
245 > # zzz prefix to ensure it sorted after store.write
245 > tr.addfinalize('zzz-forcefails', fail)
246 > tr.addfinalize('zzz-forcefails', fail)
246 > return tr
247 > return tr
247 >
248 >
248 > def uisetup(ui):
249 > def uisetup(ui):
249 > wrapfunction(localrepo.localrepository, 'transaction', wrapper)
250 > wrapfunction(localrepo.localrepository, 'transaction', wrapper)
250 >
251 >
251 > cmdtable = {}
252 > cmdtable = {}
252 >
253 >
253 > EOF
254 > EOF
254 $ rm -f "${extpath}c"
255 $ rm -f "${extpath}c"
255 $ touch z
256 $ touch z
256 $ hg ci -qAm z
257 $ hg ci -qAm z
257 transaction abort!
258 transaction abort!
258 rollback completed
259 rollback completed
259 abort: forced transaction failure
260 abort: forced transaction failure
260 [255]
261 [255]
261 $ cat .hg/store/fncache
262 $ cat .hg/store/fncache
262 data/y.i
263 data/y.i
263
264
264 Aborted transactions can be recovered later
265 Aborted transactions can be recovered later
265
266
266 $ cat > ../exceptionext.py <<EOF
267 $ cat > ../exceptionext.py <<EOF
267 > import os
268 > import os
268 > from mercurial import commands, error, transaction, localrepo
269 > from mercurial import commands, error, transaction, localrepo
269 > from mercurial.extensions import wrapfunction
270 > from mercurial.extensions import wrapfunction
270 >
271 >
271 > def trwrapper(orig, self, *args, **kwargs):
272 > def trwrapper(orig, self, *args, **kwargs):
272 > tr = orig(self, *args, **kwargs)
273 > tr = orig(self, *args, **kwargs)
273 > def fail(tr):
274 > def fail(tr):
274 > raise error.Abort("forced transaction failure")
275 > raise error.Abort("forced transaction failure")
275 > # zzz prefix to ensure it sorted after store.write
276 > # zzz prefix to ensure it sorted after store.write
276 > tr.addfinalize('zzz-forcefails', fail)
277 > tr.addfinalize('zzz-forcefails', fail)
277 > return tr
278 > return tr
278 >
279 >
279 > def abortwrapper(orig, self, *args, **kwargs):
280 > def abortwrapper(orig, self, *args, **kwargs):
280 > raise error.Abort("forced transaction failure")
281 > raise error.Abort("forced transaction failure")
281 >
282 >
282 > def uisetup(ui):
283 > def uisetup(ui):
283 > wrapfunction(localrepo.localrepository, 'transaction', trwrapper)
284 > wrapfunction(localrepo.localrepository, 'transaction', trwrapper)
284 > wrapfunction(transaction.transaction, '_abort', abortwrapper)
285 > wrapfunction(transaction.transaction, '_abort', abortwrapper)
285 >
286 >
286 > cmdtable = {}
287 > cmdtable = {}
287 >
288 >
288 > EOF
289 > EOF
289 $ rm -f "${extpath}c"
290 $ rm -f "${extpath}c"
290 $ hg up -q 1
291 $ hg up -q 1
291 $ touch z
292 $ touch z
292 $ hg ci -qAm z 2>/dev/null
293 $ hg ci -qAm z 2>/dev/null
293 [255]
294 [255]
294 $ cat .hg/store/fncache | sort
295 $ cat .hg/store/fncache | sort
295 data/y.i
296 data/y.i
296 data/z.i
297 data/z.i
297 $ hg recover
298 $ hg recover
298 rolling back interrupted transaction
299 rolling back interrupted transaction
299 checking changesets
300 checking changesets
300 checking manifests
301 checking manifests
301 crosschecking files in changesets and manifests
302 crosschecking files in changesets and manifests
302 checking files
303 checking files
303 1 files, 1 changesets, 1 total revisions
304 1 files, 1 changesets, 1 total revisions
304 $ cat .hg/store/fncache
305 $ cat .hg/store/fncache
305 data/y.i
306 data/y.i
306
307
307 $ cd ..
308 $ cd ..
308
309
309 debugrebuildfncache does nothing unless repo has fncache requirement
310 debugrebuildfncache does nothing unless repo has fncache requirement
310
311
311 $ hg --config format.usefncache=false init nofncache
312 $ hg --config format.usefncache=false init nofncache
312 $ cd nofncache
313 $ cd nofncache
313 $ hg debugrebuildfncache
314 $ hg debugrebuildfncache
314 (not rebuilding fncache because repository does not support fncache)
315 (not rebuilding fncache because repository does not support fncache)
315
316
316 $ cd ..
317 $ cd ..
317
318
318 debugrebuildfncache works on empty repository
319 debugrebuildfncache works on empty repository
319
320
320 $ hg init empty
321 $ hg init empty
321 $ cd empty
322 $ cd empty
322 $ hg debugrebuildfncache
323 $ hg debugrebuildfncache
323 fncache already up to date
324 fncache already up to date
324 $ cd ..
325 $ cd ..
325
326
326 debugrebuildfncache on an up to date repository no-ops
327 debugrebuildfncache on an up to date repository no-ops
327
328
328 $ hg init repo
329 $ hg init repo
329 $ cd repo
330 $ cd repo
330 $ echo initial > foo
331 $ echo initial > foo
331 $ echo initial > .bar
332 $ echo initial > .bar
332 $ hg commit -A -m initial
333 $ hg commit -A -m initial
333 adding .bar
334 adding .bar
334 adding foo
335 adding foo
335
336
336 $ cat .hg/store/fncache | sort
337 $ cat .hg/store/fncache | sort
337 data/.bar.i
338 data/.bar.i
338 data/foo.i
339 data/foo.i
339
340
340 $ hg debugrebuildfncache
341 $ hg debugrebuildfncache
341 fncache already up to date
342 fncache already up to date
342
343
343 debugrebuildfncache restores deleted fncache file
344 debugrebuildfncache restores deleted fncache file
344
345
345 $ rm -f .hg/store/fncache
346 $ rm -f .hg/store/fncache
346 $ hg debugrebuildfncache
347 $ hg debugrebuildfncache
347 adding data/.bar.i
348 adding data/.bar.i
348 adding data/foo.i
349 adding data/foo.i
349 2 items added, 0 removed from fncache
350 2 items added, 0 removed from fncache
350
351
351 $ cat .hg/store/fncache | sort
352 $ cat .hg/store/fncache | sort
352 data/.bar.i
353 data/.bar.i
353 data/foo.i
354 data/foo.i
354
355
355 Rebuild after rebuild should no-op
356 Rebuild after rebuild should no-op
356
357
357 $ hg debugrebuildfncache
358 $ hg debugrebuildfncache
358 fncache already up to date
359 fncache already up to date
359
360
360 A single missing file should get restored, an extra file should be removed
361 A single missing file should get restored, an extra file should be removed
361
362
362 $ cat > .hg/store/fncache << EOF
363 $ cat > .hg/store/fncache << EOF
363 > data/foo.i
364 > data/foo.i
364 > data/bad-entry.i
365 > data/bad-entry.i
365 > EOF
366 > EOF
366
367
367 $ hg debugrebuildfncache
368 $ hg debugrebuildfncache
368 removing data/bad-entry.i
369 removing data/bad-entry.i
369 adding data/.bar.i
370 adding data/.bar.i
370 1 items added, 1 removed from fncache
371 1 items added, 1 removed from fncache
371
372
372 $ cat .hg/store/fncache | sort
373 $ cat .hg/store/fncache | sort
373 data/.bar.i
374 data/.bar.i
374 data/foo.i
375 data/foo.i
375
376
376 $ cd ..
377 $ cd ..
377
378
378 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
379 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
379
380
380 $ hg --config format.dotencode=false init nodotencode
381 $ hg --config format.dotencode=false init nodotencode
381 $ cd nodotencode
382 $ cd nodotencode
382 $ echo initial > foo
383 $ echo initial > foo
383 $ echo initial > .bar
384 $ echo initial > .bar
384 $ hg commit -A -m initial
385 $ hg commit -A -m initial
385 adding .bar
386 adding .bar
386 adding foo
387 adding foo
387
388
388 $ cat .hg/store/fncache | sort
389 $ cat .hg/store/fncache | sort
389 data/.bar.i
390 data/.bar.i
390 data/foo.i
391 data/foo.i
391
392
392 $ rm .hg/store/fncache
393 $ rm .hg/store/fncache
393 $ hg debugrebuildfncache
394 $ hg debugrebuildfncache
394 adding data/.bar.i
395 adding data/.bar.i
395 adding data/foo.i
396 adding data/foo.i
396 2 items added, 0 removed from fncache
397 2 items added, 0 removed from fncache
397
398
398 $ cat .hg/store/fncache | sort
399 $ cat .hg/store/fncache | sort
399 data/.bar.i
400 data/.bar.i
400 data/foo.i
401 data/foo.i
General Comments 0
You need to be logged in to leave comments. Login now