Show More
@@ -1,386 +1,386 b'' | |||
|
1 | 1 | |
|
2 | 2 | Set up repo |
|
3 | 3 | |
|
4 | 4 | $ hg --config experimental.treemanifest=True init repo |
|
5 | 5 | $ cd repo |
|
6 | 6 | |
|
7 | 7 | Requirements get set on init |
|
8 | 8 | |
|
9 | 9 | $ grep treemanifest .hg/requires |
|
10 | 10 | treemanifest |
|
11 | 11 | |
|
12 | 12 | Without directories, looks like any other repo |
|
13 | 13 | |
|
14 | 14 | $ echo 0 > a |
|
15 | 15 | $ echo 0 > b |
|
16 | 16 | $ hg ci -Aqm initial |
|
17 | 17 | $ hg debugdata -m 0 |
|
18 | 18 | a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) |
|
19 | 19 | b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) |
|
20 | 20 | |
|
21 | 21 | Submanifest is stored in separate revlog |
|
22 | 22 | |
|
23 | 23 | $ mkdir dir1 |
|
24 | 24 | $ echo 1 > dir1/a |
|
25 | 25 | $ echo 1 > dir1/b |
|
26 | 26 | $ echo 1 > e |
|
27 | 27 | $ hg ci -Aqm 'add dir1' |
|
28 | 28 | $ hg debugdata -m 1 |
|
29 | 29 | a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) |
|
30 | 30 | b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) |
|
31 | 31 | dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44ed (esc) |
|
32 | 32 | e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) |
|
33 | 33 | $ hg debugdata --dir dir1 0 |
|
34 | 34 | a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) |
|
35 | 35 | b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) |
|
36 | 36 | |
|
37 | 37 | Can add nested directories |
|
38 | 38 | |
|
39 | 39 | $ mkdir dir1/dir1 |
|
40 | 40 | $ echo 2 > dir1/dir1/a |
|
41 | 41 | $ echo 2 > dir1/dir1/b |
|
42 | 42 | $ mkdir dir1/dir2 |
|
43 | 43 | $ echo 2 > dir1/dir2/a |
|
44 | 44 | $ echo 2 > dir1/dir2/b |
|
45 | 45 | $ hg ci -Aqm 'add dir1/dir1' |
|
46 | 46 | $ hg files -r . |
|
47 | 47 | a |
|
48 | 48 | b |
|
49 | 49 | dir1/a (glob) |
|
50 | 50 | dir1/b (glob) |
|
51 | 51 | dir1/dir1/a (glob) |
|
52 | 52 | dir1/dir1/b (glob) |
|
53 | 53 | dir1/dir2/a (glob) |
|
54 | 54 | dir1/dir2/b (glob) |
|
55 | 55 | e |
|
56 | 56 | |
|
57 | 57 | Revision is not created for unchanged directory |
|
58 | 58 | |
|
59 | 59 | $ mkdir dir2 |
|
60 | 60 | $ echo 3 > dir2/a |
|
61 | 61 | $ hg add dir2 |
|
62 | 62 | adding dir2/a (glob) |
|
63 | 63 | $ hg debugindex --dir dir1 > before |
|
64 | 64 | $ hg ci -qm 'add dir2' |
|
65 | 65 | $ hg debugindex --dir dir1 > after |
|
66 | 66 | $ diff before after |
|
67 | 67 | $ rm before after |
|
68 | 68 | |
|
69 | 69 | Removing directory does not create an revlog entry |
|
70 | 70 | |
|
71 | 71 | $ hg rm dir1/dir1 |
|
72 | 72 | removing dir1/dir1/a (glob) |
|
73 | 73 | removing dir1/dir1/b (glob) |
|
74 | 74 | $ hg debugindex --dir dir1/dir1 > before |
|
75 | 75 | $ hg ci -qm 'remove dir1/dir1' |
|
76 | 76 | $ hg debugindex --dir dir1/dir1 > after |
|
77 | 77 | $ diff before after |
|
78 | 78 | $ rm before after |
|
79 | 79 | |
|
80 | 80 | Check that hg files (calls treemanifest.walk()) works |
|
81 | 81 | without loading all directory revlogs |
|
82 | 82 | |
|
83 | 83 | $ hg co 'desc("add dir2")' |
|
84 | 84 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
85 | 85 | $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup |
|
86 | 86 | $ hg files -r . dir1 |
|
87 | 87 | dir1/a (glob) |
|
88 | 88 | dir1/b (glob) |
|
89 | 89 | dir1/dir1/a (glob) |
|
90 | 90 | dir1/dir1/b (glob) |
|
91 | 91 | dir1/dir2/a (glob) |
|
92 | 92 | dir1/dir2/b (glob) |
|
93 | 93 | |
|
94 | 94 | Check that status between revisions works (calls treemanifest.matches()) |
|
95 | 95 | without loading all directory revlogs |
|
96 | 96 | |
|
97 | 97 | $ hg status --rev 'desc("add dir1")' --rev . dir1 |
|
98 | 98 | A dir1/dir1/a |
|
99 | 99 | A dir1/dir1/b |
|
100 | 100 | A dir1/dir2/a |
|
101 | 101 | A dir1/dir2/b |
|
102 | 102 | $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2 |
|
103 | 103 | |
|
104 | 104 | Merge creates 2-parent revision of directory revlog |
|
105 | 105 | |
|
106 | 106 | $ echo 5 > dir1/a |
|
107 | 107 | $ hg ci -Aqm 'modify dir1/a' |
|
108 | 108 | $ hg co '.^' |
|
109 | 109 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
110 | 110 | $ echo 6 > dir1/b |
|
111 | 111 | $ hg ci -Aqm 'modify dir1/b' |
|
112 | 112 | $ hg merge 'desc("modify dir1/a")' |
|
113 | 113 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
114 | 114 | (branch merge, don't forget to commit) |
|
115 | 115 | $ hg ci -m 'conflict-free merge involving dir1/' |
|
116 | 116 | $ cat dir1/a |
|
117 | 117 | 5 |
|
118 | 118 | $ cat dir1/b |
|
119 | 119 | 6 |
|
120 | 120 | $ hg debugindex --dir dir1 |
|
121 | 121 | rev offset length base linkrev nodeid p1 p2 |
|
122 | 122 | 0 0 54 0 1 8b3ffd73f901 000000000000 000000000000 |
|
123 | 123 | 1 54 68 0 2 b66d046c644f 8b3ffd73f901 000000000000 |
|
124 | 124 | 2 122 12 0 4 b87265673c8a b66d046c644f 000000000000 |
|
125 | 125 | 3 134 95 0 5 aa5d3adcec72 b66d046c644f 000000000000 |
|
126 | 126 | 4 229 81 0 6 e29b066b91ad b66d046c644f 000000000000 |
|
127 | 127 | 5 310 107 5 7 a120ce2b83f5 e29b066b91ad aa5d3adcec72 |
|
128 | 128 | |
|
129 | 129 | Merge keeping directory from parent 1 does not create revlog entry. (Note that |
|
130 | 130 | dir1's manifest does change, but only because dir1/a's filelog changes.) |
|
131 | 131 | |
|
132 | 132 | $ hg co 'desc("add dir2")' |
|
133 | 133 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
134 | 134 | $ echo 8 > dir2/a |
|
135 | 135 | $ hg ci -m 'modify dir2/a' |
|
136 | 136 | created new head |
|
137 | 137 | |
|
138 | 138 | $ hg debugindex --dir dir2 > before |
|
139 | 139 | $ hg merge 'desc("modify dir1/a")' |
|
140 | 140 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
141 | 141 | (branch merge, don't forget to commit) |
|
142 | 142 | $ hg revert -r 'desc("modify dir2/a")' . |
|
143 | 143 | reverting dir1/a (glob) |
|
144 | 144 | $ hg ci -m 'merge, keeping parent 1' |
|
145 | 145 | $ hg debugindex --dir dir2 > after |
|
146 | 146 | $ diff before after |
|
147 | 147 | $ rm before after |
|
148 | 148 | |
|
149 | 149 | Merge keeping directory from parent 2 does not create revlog entry. (Note that |
|
150 | 150 | dir2's manifest does change, but only because dir2/a's filelog changes.) |
|
151 | 151 | |
|
152 | 152 | $ hg co 'desc("modify dir2/a")' |
|
153 | 153 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
154 | 154 | $ hg debugindex --dir dir1 > before |
|
155 | 155 | $ hg merge 'desc("modify dir1/a")' |
|
156 | 156 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
157 | 157 | (branch merge, don't forget to commit) |
|
158 | 158 | $ hg revert -r 'desc("modify dir1/a")' . |
|
159 | 159 | reverting dir2/a (glob) |
|
160 | 160 | $ hg ci -m 'merge, keeping parent 2' |
|
161 | 161 | created new head |
|
162 | 162 | $ hg debugindex --dir dir1 > after |
|
163 | 163 | $ diff before after |
|
164 | 164 | $ rm before after |
|
165 | 165 | |
|
166 | 166 | Create flat source repo for tests with mixed flat/tree manifests |
|
167 | 167 | |
|
168 | 168 | $ cd .. |
|
169 | 169 | $ hg init repo-flat |
|
170 | 170 | $ cd repo-flat |
|
171 | 171 | |
|
172 | 172 | Create a few commits with flat manifest |
|
173 | 173 | |
|
174 | 174 | $ echo 0 > a |
|
175 | 175 | $ echo 0 > b |
|
176 | 176 | $ echo 0 > e |
|
177 | 177 | $ for d in dir1 dir1/dir1 dir1/dir2 dir2 |
|
178 | 178 | > do |
|
179 | 179 | > mkdir $d |
|
180 | 180 | > echo 0 > $d/a |
|
181 | 181 | > echo 0 > $d/b |
|
182 | 182 | > done |
|
183 | 183 | $ hg ci -Aqm initial |
|
184 | 184 | |
|
185 | 185 | $ echo 1 > a |
|
186 | 186 | $ echo 1 > dir1/a |
|
187 | 187 | $ echo 1 > dir1/dir1/a |
|
188 | 188 | $ hg ci -Aqm 'modify on branch 1' |
|
189 | 189 | |
|
190 | 190 | $ hg co 0 |
|
191 | 191 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
192 | 192 | $ echo 2 > b |
|
193 | 193 | $ echo 2 > dir1/b |
|
194 | 194 | $ echo 2 > dir1/dir1/b |
|
195 | 195 | $ hg ci -Aqm 'modify on branch 2' |
|
196 | 196 | |
|
197 | 197 | $ hg merge 1 |
|
198 | 198 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
199 | 199 | (branch merge, don't forget to commit) |
|
200 | 200 | $ hg ci -m 'merge of flat manifests to new flat manifest' |
|
201 | 201 | |
|
202 | 202 | Create clone with tree manifests enabled |
|
203 | 203 | |
|
204 | 204 | $ cd .. |
|
205 | 205 | $ hg clone --pull --config experimental.treemanifest=1 repo-flat repo-mixed |
|
206 | 206 | requesting all changes |
|
207 | 207 | adding changesets |
|
208 | 208 | adding manifests |
|
209 | 209 | adding file changes |
|
210 | 210 | added 4 changesets with 17 changes to 11 files |
|
211 | 211 | updating to branch default |
|
212 | 212 | 11 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
213 | 213 | $ cd repo-mixed |
|
214 | 214 | $ test -f .hg/store/meta |
|
215 | 215 | [1] |
|
216 | 216 | $ grep treemanifest .hg/requires |
|
217 | 217 | treemanifest |
|
218 | 218 | |
|
219 | 219 | Commit should store revlog per directory |
|
220 | 220 | |
|
221 | 221 | $ hg co 1 |
|
222 | 222 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
223 | 223 | $ echo 3 > a |
|
224 | 224 | $ echo 3 > dir1/a |
|
225 | 225 | $ echo 3 > dir1/dir1/a |
|
226 | 226 | $ hg ci -m 'first tree' |
|
227 | 227 | created new head |
|
228 | 228 | $ find .hg/store/meta | sort |
|
229 | 229 | .hg/store/meta |
|
230 | 230 | .hg/store/meta/dir1 |
|
231 | 231 | .hg/store/meta/dir1/00manifest.i |
|
232 | 232 | .hg/store/meta/dir1/dir1 |
|
233 | 233 | .hg/store/meta/dir1/dir1/00manifest.i |
|
234 | 234 | .hg/store/meta/dir1/dir2 |
|
235 | 235 | .hg/store/meta/dir1/dir2/00manifest.i |
|
236 | 236 | .hg/store/meta/dir2 |
|
237 | 237 | .hg/store/meta/dir2/00manifest.i |
|
238 | 238 | |
|
239 | 239 | Merge of two trees |
|
240 | 240 | |
|
241 | 241 | $ hg co 2 |
|
242 | 242 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
243 | 243 | $ hg merge 1 |
|
244 | 244 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
245 | 245 | (branch merge, don't forget to commit) |
|
246 | 246 | $ hg ci -m 'merge of flat manifests to new tree manifest' |
|
247 | 247 | created new head |
|
248 | 248 | $ hg diff -r 3 |
|
249 | 249 | |
|
250 | 250 | Parent of tree root manifest should be flat manifest, and two for merge |
|
251 | 251 | |
|
252 | 252 | $ hg debugindex -m |
|
253 | 253 | rev offset length base linkrev nodeid p1 p2 |
|
254 | 254 | 0 0 80 0 0 40536115ed9e 000000000000 000000000000 |
|
255 | 255 | 1 80 83 0 1 f3376063c255 40536115ed9e 000000000000 |
|
256 | 256 | 2 163 103 0 2 5d9b9da231a2 40536115ed9e 000000000000 |
|
257 | 257 | 3 266 83 0 3 d17d663cbd8a 5d9b9da231a2 f3376063c255 |
|
258 | 258 | 4 349 132 4 4 c05a51345f86 f3376063c255 000000000000 |
|
259 | 259 | 5 481 110 4 5 82594b1f557d 5d9b9da231a2 f3376063c255 |
|
260 | 260 | |
|
261 | 261 | |
|
262 | 262 | Status across flat/tree boundary should work |
|
263 | 263 | |
|
264 | 264 | $ hg status --rev '.^' --rev . |
|
265 | 265 | M a |
|
266 | 266 | M dir1/a |
|
267 | 267 | M dir1/dir1/a |
|
268 | 268 | |
|
269 | 269 | |
|
270 | 270 | Turning off treemanifest config has no effect |
|
271 | 271 | |
|
272 | 272 | $ hg debugindex .hg/store/meta/dir1/00manifest.i |
|
273 | 273 | rev offset length base linkrev nodeid p1 p2 |
|
274 | 274 | 0 0 125 0 4 63c9c0557d24 000000000000 000000000000 |
|
275 | 275 | 1 125 109 0 5 23d12a1f6e0e 000000000000 000000000000 |
|
276 | 276 | $ echo 2 > dir1/a |
|
277 | 277 | $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a' |
|
278 | 278 | $ hg debugindex .hg/store/meta/dir1/00manifest.i |
|
279 | 279 | rev offset length base linkrev nodeid p1 p2 |
|
280 | 280 | 0 0 125 0 4 63c9c0557d24 000000000000 000000000000 |
|
281 | 281 | 1 125 109 0 5 23d12a1f6e0e 000000000000 000000000000 |
|
282 | 282 | 2 234 55 0 6 3cb2d87b4250 23d12a1f6e0e 000000000000 |
|
283 | 283 | |
|
284 | 284 | Create deeper repo with tree manifests. |
|
285 | 285 | |
|
286 | 286 | $ cd .. |
|
287 | 287 | $ hg --config experimental.treemanifest=True init deeprepo |
|
288 | 288 | $ cd deeprepo |
|
289 | 289 | |
|
290 | 290 | $ mkdir a |
|
291 | 291 | $ mkdir b |
|
292 | 292 | $ mkdir b/bar |
|
293 | 293 | $ mkdir b/bar/orange |
|
294 | 294 | $ mkdir b/bar/orange/fly |
|
295 | 295 | $ mkdir b/foo |
|
296 | 296 | $ mkdir b/foo/apple |
|
297 | 297 | $ mkdir b/foo/apple/bees |
|
298 | 298 | |
|
299 | 299 | $ touch a/one.txt |
|
300 | 300 | $ touch a/two.txt |
|
301 | 301 | $ touch b/bar/fruits.txt |
|
302 | 302 | $ touch b/bar/orange/fly/gnat.py |
|
303 | 303 | $ touch b/bar/orange/fly/housefly.txt |
|
304 | 304 | $ touch b/foo/apple/bees/flower.py |
|
305 | 305 | $ touch c.txt |
|
306 | 306 | $ touch d.py |
|
307 | 307 | |
|
308 | 308 | $ hg ci -Aqm 'initial' |
|
309 | 309 | |
|
310 | 310 | We'll see that visitdir works by removing some treemanifest revlogs and running |
|
311 | 311 | the files command with various parameters. |
|
312 | 312 | |
|
313 | 313 | Test files from the root. |
|
314 | 314 | |
|
315 | 315 | $ hg files -r . |
|
316 | 316 | a/one.txt (glob) |
|
317 | 317 | a/two.txt (glob) |
|
318 | 318 | b/bar/fruits.txt (glob) |
|
319 | 319 | b/bar/orange/fly/gnat.py (glob) |
|
320 | 320 | b/bar/orange/fly/housefly.txt (glob) |
|
321 | 321 | b/foo/apple/bees/flower.py (glob) |
|
322 | 322 | c.txt |
|
323 | 323 | d.py |
|
324 | 324 | |
|
325 | 325 | Excludes with a glob should not exclude everything from the glob's root |
|
326 | 326 | |
|
327 | 327 | $ hg files -r . -X 'b/fo?' b |
|
328 | b/bar/fruits.txt | |
|
329 | b/bar/orange/fly/gnat.py | |
|
330 | b/bar/orange/fly/housefly.txt | |
|
328 | b/bar/fruits.txt (glob) | |
|
329 | b/bar/orange/fly/gnat.py (glob) | |
|
330 | b/bar/orange/fly/housefly.txt (glob) | |
|
331 | 331 | |
|
332 | 332 | Test files for a subdirectory. |
|
333 | 333 | |
|
334 | 334 | $ mv .hg/store/meta/a oldmf |
|
335 | 335 | $ hg files -r . b |
|
336 | 336 | b/bar/fruits.txt (glob) |
|
337 | 337 | b/bar/orange/fly/gnat.py (glob) |
|
338 | 338 | b/bar/orange/fly/housefly.txt (glob) |
|
339 | 339 | b/foo/apple/bees/flower.py (glob) |
|
340 | 340 | $ mv oldmf .hg/store/meta/a |
|
341 | 341 | |
|
342 | 342 | Test files with just includes and excludes. |
|
343 | 343 | |
|
344 | 344 | $ mv .hg/store/meta/a oldmf |
|
345 | 345 | $ mv .hg/store/meta/b/bar/orange/fly oldmf2 |
|
346 | 346 | $ mv .hg/store/meta/b/foo/apple/bees oldmf3 |
|
347 | 347 | $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees |
|
348 | 348 | b/bar/fruits.txt (glob) |
|
349 | 349 | $ mv oldmf .hg/store/meta/a |
|
350 | 350 | $ mv oldmf2 .hg/store/meta/b/bar/orange/fly |
|
351 | 351 | $ mv oldmf3 .hg/store/meta/b/foo/apple/bees |
|
352 | 352 | |
|
353 | 353 | Test files for a subdirectory, excluding a directory within it. |
|
354 | 354 | |
|
355 | 355 | $ mv .hg/store/meta/a oldmf |
|
356 | 356 | $ mv .hg/store/meta/b/foo oldmf2 |
|
357 | 357 | $ hg files -r . -X path:b/foo b |
|
358 | 358 | b/bar/fruits.txt (glob) |
|
359 | 359 | b/bar/orange/fly/gnat.py (glob) |
|
360 | 360 | b/bar/orange/fly/housefly.txt (glob) |
|
361 | 361 | $ mv oldmf .hg/store/meta/a |
|
362 | 362 | $ mv oldmf2 .hg/store/meta/b/foo |
|
363 | 363 | |
|
364 | 364 | Test files for a sub directory, including only a directory within it, and |
|
365 | 365 | including an unrelated directory. |
|
366 | 366 | |
|
367 | 367 | $ mv .hg/store/meta/a oldmf |
|
368 | 368 | $ mv .hg/store/meta/b/foo oldmf2 |
|
369 | 369 | $ hg files -r . -I path:b/bar/orange -I path:a b |
|
370 | 370 | b/bar/orange/fly/gnat.py (glob) |
|
371 | 371 | b/bar/orange/fly/housefly.txt (glob) |
|
372 | 372 | $ mv oldmf .hg/store/meta/a |
|
373 | 373 | $ mv oldmf2 .hg/store/meta/b/foo |
|
374 | 374 | |
|
375 | 375 | Test files for a pattern, including a directory, and excluding a directory |
|
376 | 376 | within that. |
|
377 | 377 | |
|
378 | 378 | $ mv .hg/store/meta/a oldmf |
|
379 | 379 | $ mv .hg/store/meta/b/foo oldmf2 |
|
380 | 380 | $ mv .hg/store/meta/b/bar/orange oldmf3 |
|
381 | 381 | $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange |
|
382 | 382 | b/bar/fruits.txt (glob) |
|
383 | 383 | $ mv oldmf .hg/store/meta/a |
|
384 | 384 | $ mv oldmf2 .hg/store/meta/b/foo |
|
385 | 385 | $ mv oldmf3 .hg/store/meta/b/bar/orange |
|
386 | 386 |
General Comments 0
You need to be logged in to leave comments.
Login now