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