Show More
@@ -1,381 +1,401 | |||
|
1 | 1 | |
|
2 | 2 | $ echo "[extensions]" >> $HGRCPATH |
|
3 | 3 | $ echo "largefiles =" >> $HGRCPATH |
|
4 | 4 | |
|
5 | 5 | Create the repository outside $HOME since largefiles write to |
|
6 | 6 | $HOME/.cache/largefiles. |
|
7 | 7 | |
|
8 | 8 | $ hg init test |
|
9 | 9 | $ cd test |
|
10 | 10 | $ echo "root" > root |
|
11 | 11 | $ hg add root |
|
12 | $ hg commit -m "Root commit" | |
|
12 | $ hg commit -m "Root commit" --config extensions.largefiles=! | |
|
13 | ||
|
14 | Ensure that .hg/largefiles isn't created before largefiles are added | |
|
15 | #if unix-permissions | |
|
16 | $ chmod 555 .hg | |
|
17 | #endif | |
|
18 | $ hg status | |
|
19 | #if unix-permissions | |
|
20 | $ chmod 755 .hg | |
|
21 | #endif | |
|
22 | ||
|
23 | $ test -f .hg/largefiles | |
|
24 | [1] | |
|
13 | 25 | |
|
14 | 26 | $ echo "large" > foo |
|
15 | 27 | $ hg add --large foo |
|
16 | 28 | $ hg commit -m "Add foo as a largefile" |
|
17 | 29 | |
|
18 | 30 | $ hg update -r 0 |
|
19 | 31 | getting changed largefiles |
|
20 | 32 | 0 largefiles updated, 1 removed |
|
21 | 33 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
22 | 34 | |
|
23 | 35 | $ echo "normal" > foo |
|
24 | 36 | $ hg add foo |
|
25 | 37 | $ hg commit -m "Add foo as normal file" |
|
26 | 38 | created new head |
|
27 | 39 | |
|
28 | 40 | Normal file in the working copy, keeping the normal version: |
|
29 | 41 | |
|
30 | 42 | $ echo "n" | hg merge --config ui.interactive=Yes |
|
31 | 43 | remote turned local normal file foo into a largefile |
|
32 | 44 | use (l)argefile or keep (n)ormal file? n |
|
33 | 45 | getting changed largefiles |
|
34 | 46 | 0 largefiles updated, 0 removed |
|
35 | 47 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
36 | 48 |
|
|
37 | 49 | |
|
38 | 50 | $ hg status |
|
39 | 51 | $ cat foo |
|
40 | 52 | normal |
|
41 | 53 | |
|
42 | 54 | Normal file in the working copy, keeping the largefile version: |
|
43 | 55 | |
|
44 | 56 | $ hg update -q -C |
|
45 | 57 | $ echo "l" | hg merge --config ui.interactive=Yes |
|
46 | 58 | remote turned local normal file foo into a largefile |
|
47 | 59 | use (l)argefile or keep (n)ormal file? l |
|
48 | 60 | getting changed largefiles |
|
49 | 61 | 1 largefiles updated, 0 removed |
|
50 | 62 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
51 | 63 | (branch merge, don't forget to commit) |
|
52 | 64 | |
|
53 | 65 | $ hg status |
|
54 | 66 | M foo |
|
55 | 67 | |
|
56 | 68 | $ hg diff --nodates |
|
57 | 69 | diff -r fa129ab6b5a7 .hglf/foo |
|
58 | 70 | --- /dev/null |
|
59 | 71 | +++ b/.hglf/foo |
|
60 | 72 | @@ -0,0 +1,1 @@ |
|
61 | 73 | +7f7097b041ccf68cc5561e9600da4655d21c6d18 |
|
62 | 74 | diff -r fa129ab6b5a7 foo |
|
63 | 75 | --- a/foo |
|
64 | 76 | +++ /dev/null |
|
65 | 77 | @@ -1,1 +0,0 @@ |
|
66 | 78 | -normal |
|
67 | 79 | |
|
68 | 80 | $ cat foo |
|
69 | 81 | large |
|
70 | 82 | |
|
71 | 83 | Largefile in the working copy, keeping the normal version: |
|
72 | 84 | |
|
73 | 85 | $ hg update -q -C -r 1 |
|
74 | 86 | $ echo "n" | hg merge --config ui.interactive=Yes |
|
75 | 87 | remote turned local largefile foo into a normal file |
|
76 | 88 | keep (l)argefile or use (n)ormal file? n |
|
77 | 89 | getting changed largefiles |
|
78 | 90 | 0 largefiles updated, 0 removed |
|
79 | 91 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
80 | 92 |
|
|
81 | 93 | |
|
82 | 94 | $ hg status |
|
83 | 95 | M foo |
|
84 | 96 | |
|
85 | 97 | $ hg diff --nodates |
|
86 | 98 | diff -r ff521236428a .hglf/foo |
|
87 | 99 | --- a/.hglf/foo |
|
88 | 100 | +++ /dev/null |
|
89 | 101 | @@ -1,1 +0,0 @@ |
|
90 | 102 | -7f7097b041ccf68cc5561e9600da4655d21c6d18 |
|
91 | 103 | diff -r ff521236428a foo |
|
92 | 104 | --- /dev/null |
|
93 | 105 | +++ b/foo |
|
94 | 106 | @@ -0,0 +1,1 @@ |
|
95 | 107 | +normal |
|
96 | 108 | |
|
97 | 109 | $ cat foo |
|
98 | 110 | normal |
|
99 | 111 | |
|
100 | 112 | Largefile in the working copy, keeping the largefile version: |
|
101 | 113 | |
|
102 | 114 | $ hg update -q -C -r 1 |
|
103 | 115 | $ echo "l" | hg merge --config ui.interactive=Yes |
|
104 | 116 | remote turned local largefile foo into a normal file |
|
105 | 117 | keep (l)argefile or use (n)ormal file? l |
|
106 | 118 | getting changed largefiles |
|
107 | 119 | 1 largefiles updated, 0 removed |
|
108 | 120 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
109 | 121 | (branch merge, don't forget to commit) |
|
110 | 122 | |
|
111 | 123 | $ hg status |
|
112 | 124 | |
|
113 | 125 | $ cat foo |
|
114 | 126 | large |
|
115 | 127 | |
|
116 | 128 | Whatever ... commit something so we can invoke merge when updating |
|
117 | 129 | |
|
118 | 130 |
$ |
|
119 | 131 | |
|
120 | 132 | Updating from largefile to normal - no reason to prompt |
|
121 | 133 | |
|
122 | 134 | $ hg up -r 2 |
|
123 | 135 | getting changed largefiles |
|
124 | 136 | 0 largefiles updated, 0 removed |
|
125 | 137 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
126 | 138 | $ cat foo |
|
127 | 139 | normal |
|
128 | 140 | |
|
129 | 141 | (the update above used to leave the working dir in a very weird state - clean it |
|
130 | 142 | $ hg up -qr null |
|
131 | 143 | $ hg up -qr 2 |
|
132 | 144 |
|
|
133 | 145 | |
|
134 | 146 | Updating from normal to largefile - no reason to prompt |
|
135 | 147 | |
|
136 | 148 | $ hg up -r 3 |
|
137 | 149 | getting changed largefiles |
|
138 | 150 | 1 largefiles updated, 0 removed |
|
139 | 151 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
140 | 152 | $ cat foo |
|
141 | 153 | large |
|
142 | 154 | |
|
143 | 155 | $ cd .. |
|
144 | 156 | |
|
145 | 157 | |
|
146 | 158 | Systematic testing of merges involving largefiles: |
|
147 | 159 | |
|
148 |
Ancestor: normal Parent: normal |
|
|
160 | Ancestor: normal Parent: normal-id Parent: large result: large | |
|
149 | 161 | Ancestor: normal Parent: normal2 Parent: large result: ? |
|
150 |
Ancestor: large Parent: large |
|
|
162 | Ancestor: large Parent: large-id Parent: normal result: normal | |
|
151 | 163 | Ancestor: large Parent: large2 Parent: normal result: ? |
|
152 | 164 | |
|
153 | 165 | All cases should try merging both ways. |
|
154 | "=" means same file content. | |
|
155 | 166 | |
|
156 | 167 | Prepare test repo: |
|
157 | 168 | |
|
158 | 169 | $ hg init merges |
|
159 | 170 | $ cd merges |
|
160 | $ touch f1 | |
|
161 | $ hg ci -Aqm "0-root" --config extensions.largefiles=! | |
|
162 | 171 | |
|
163 | Ensure that .hg/largefiles isn't created before largefiles are added | |
|
164 | #if unix-permissions | |
|
165 | $ chmod 555 .hg | |
|
166 | #endif | |
|
167 | $ hg status | |
|
168 | #if unix-permissions | |
|
169 | $ chmod 755 .hg | |
|
170 | #endif | |
|
172 | prepare cases with "normal" ancestor: | |
|
171 | 173 | |
|
172 | $ test -f .hg/largefiles | |
|
173 | [1] | |
|
174 | ||
|
175 | ancestor is "normal": | |
|
174 | $ hg up -qr null | |
|
176 | 175 | $ echo normal > f |
|
177 |
$ hg ci -Aqm " |
|
|
176 | $ hg ci -Aqm "normal-ancestor" | |
|
177 | $ hg tag -l "normal-ancestor" | |
|
178 | 178 | $ touch f2 |
|
179 |
$ hg ci -Aqm " |
|
|
180 |
$ hg tag -l "normal |
|
|
179 | $ hg ci -Aqm "normal-id" | |
|
180 | $ hg tag -l "normal-id" | |
|
181 | 181 | $ echo normal2 > f |
|
182 |
$ hg ci -m " |
|
|
182 | $ hg ci -m "normal2" | |
|
183 | 183 | $ hg tag -l "normal2" |
|
184 |
$ hg up -qr |
|
|
184 | $ hg up -qr "normal-ancestor" | |
|
185 | 185 | $ hg rm f |
|
186 | 186 | $ echo large > f |
|
187 | 187 | $ hg add --large f |
|
188 |
$ hg ci -qm " |
|
|
188 | $ hg ci -qm "large" | |
|
189 | 189 | $ hg tag -l "large" |
|
190 | 190 | |
|
191 | $ hg up -qr null | |
|
191 | prepare cases with "large" ancestor: | |
|
192 | 192 | |
|
193 | ancestor is "large": | |
|
193 | $ hg up -qr null | |
|
194 | 194 | $ echo large > f |
|
195 | 195 | $ hg add --large f |
|
196 |
$ hg ci -qm " |
|
|
196 | $ hg ci -qm "large-ancestor" | |
|
197 | $ hg tag -l "large-ancestor" | |
|
197 | 198 | $ touch f2 |
|
198 |
$ hg ci -Aqm " |
|
|
199 |
$ hg tag -l "large |
|
|
199 | $ hg ci -Aqm "large-id" | |
|
200 | $ hg tag -l "large-id" | |
|
200 | 201 | $ echo large2 > f |
|
201 |
$ hg ci -m " |
|
|
202 | $ hg ci -m "large2" | |
|
202 | 203 | $ hg tag -l "large2" |
|
203 |
$ hg up -qr |
|
|
204 | $ hg up -qr "large-ancestor" | |
|
204 | 205 | $ hg rm f |
|
205 | 206 | $ echo normal > f |
|
206 |
$ hg ci -qAm " |
|
|
207 | $ hg ci -qAm "normal" | |
|
207 | 208 | $ hg tag -l "normal" |
|
208 | 209 | |
|
209 | Ancestor: normal Parent: normal= Parent: large result: large | |
|
210 | $ hg log -GT '{tags}' | |
|
211 | @ normal tip | |
|
212 | | | |
|
213 | | o large2 | |
|
214 | | | | |
|
215 | | o large-id | |
|
216 | |/ | |
|
217 | o large-ancestor | |
|
210 | 218 | |
|
211 | $ hg up -Cqr normal= | |
|
219 | o large | |
|
220 | | | |
|
221 | | o normal2 | |
|
222 | | | | |
|
223 | | o normal-id | |
|
224 | |/ | |
|
225 | o normal-ancestor | |
|
226 | ||
|
227 | ||
|
228 | ||
|
229 | Ancestor: normal Parent: normal-id Parent: large result: large | |
|
230 | ||
|
231 | $ hg up -Cqr normal-id | |
|
212 | 232 | $ hg merge -r large |
|
213 | 233 | getting changed largefiles |
|
214 | 234 | 1 largefiles updated, 0 removed |
|
215 | 235 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
216 | 236 | (branch merge, don't forget to commit) |
|
217 | 237 | $ cat f |
|
218 | 238 | large |
|
219 | 239 | |
|
220 | 240 | swap |
|
221 | 241 | |
|
222 | 242 | $ hg up -Cqr large |
|
223 |
$ hg merge -r normal |
|
|
243 | $ hg merge -r normal-id | |
|
224 | 244 | getting changed largefiles |
|
225 | 245 | 0 largefiles updated, 0 removed |
|
226 | 246 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
227 | 247 | (branch merge, don't forget to commit) |
|
228 | 248 | $ cat f |
|
229 | 249 | large |
|
230 | 250 | |
|
231 | 251 | Ancestor: normal Parent: normal2 Parent: large result: ? |
|
232 | 252 | (annoying extra prompt ... but it do not do any serious harm) |
|
233 | 253 | |
|
234 | 254 | $ hg up -Cqr normal2 |
|
235 | 255 | $ hg merge -r large |
|
236 | 256 | local changed f which remote deleted |
|
237 | 257 | use (c)hanged version or (d)elete? c |
|
238 | 258 | remote turned local normal file f into a largefile |
|
239 | 259 | use (l)argefile or keep (n)ormal file? l |
|
240 | 260 | getting changed largefiles |
|
241 | 261 | 1 largefiles updated, 0 removed |
|
242 | 262 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
243 | 263 | (branch merge, don't forget to commit) |
|
244 | 264 | $ cat f |
|
245 | 265 | large |
|
246 | 266 | |
|
247 | 267 | $ hg up -Cqr normal2 |
|
248 | 268 | $ ( echo c; echo n ) | hg merge -r large --config ui.interactive=Yes |
|
249 | 269 | local changed f which remote deleted |
|
250 | 270 | use (c)hanged version or (d)elete? c |
|
251 | 271 | remote turned local normal file f into a largefile |
|
252 | 272 | use (l)argefile or keep (n)ormal file? n |
|
253 | 273 | getting changed largefiles |
|
254 | 274 | 0 largefiles updated, 0 removed |
|
255 | 275 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
256 | 276 | (branch merge, don't forget to commit) |
|
257 | 277 | $ cat f |
|
258 | 278 | normal2 |
|
259 | 279 | |
|
260 | 280 | $ hg up -Cqr normal2 |
|
261 | 281 | $ echo d | hg merge -r large --config ui.interactive=Yes |
|
262 | 282 | local changed f which remote deleted |
|
263 | 283 | use (c)hanged version or (d)elete? d |
|
264 | 284 | getting changed largefiles |
|
265 | 285 | 1 largefiles updated, 0 removed |
|
266 | 286 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
267 | 287 | (branch merge, don't forget to commit) |
|
268 | 288 | $ cat f |
|
269 | 289 | large |
|
270 | 290 | |
|
271 | 291 | swap |
|
272 | 292 | |
|
273 | 293 | $ hg up -Cqr large |
|
274 | 294 | $ hg merge -r normal2 |
|
275 | 295 | remote changed f which local deleted |
|
276 | 296 | use (c)hanged version or leave (d)eleted? c |
|
277 | 297 | remote turned local largefile f into a normal file |
|
278 | 298 | keep (l)argefile or use (n)ormal file? l |
|
279 | 299 | getting changed largefiles |
|
280 | 300 | 1 largefiles updated, 0 removed |
|
281 | 301 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
282 | 302 | (branch merge, don't forget to commit) |
|
283 | 303 | $ cat f |
|
284 | 304 | large |
|
285 | 305 | |
|
286 | 306 | $ hg up -Cqr large |
|
287 | 307 | $ ( echo c; echo n ) | hg merge -r normal2 --config ui.interactive=Yes |
|
288 | 308 | remote changed f which local deleted |
|
289 | 309 | use (c)hanged version or leave (d)eleted? c |
|
290 | 310 | remote turned local largefile f into a normal file |
|
291 | 311 | keep (l)argefile or use (n)ormal file? n |
|
292 | 312 | getting changed largefiles |
|
293 | 313 | 0 largefiles updated, 0 removed |
|
294 | 314 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
295 | 315 | (branch merge, don't forget to commit) |
|
296 | 316 | $ cat f |
|
297 | 317 | normal2 |
|
298 | 318 | |
|
299 | 319 | $ hg up -Cqr large |
|
300 | 320 | $ echo d | hg merge -r normal2 --config ui.interactive=Yes |
|
301 | 321 | remote changed f which local deleted |
|
302 | 322 | use (c)hanged version or leave (d)eleted? d |
|
303 | 323 | getting changed largefiles |
|
304 | 324 | 0 largefiles updated, 0 removed |
|
305 | 325 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
306 | 326 | (branch merge, don't forget to commit) |
|
307 | 327 | $ cat f |
|
308 | 328 | large |
|
309 | 329 | |
|
310 |
Ancestor: large Parent: large |
|
|
330 | Ancestor: large Parent: large-id Parent: normal result: normal | |
|
311 | 331 | |
|
312 |
$ hg up -Cqr large |
|
|
332 | $ hg up -Cqr large-id | |
|
313 | 333 | $ hg merge -r normal |
|
314 | 334 | getting changed largefiles |
|
315 | 335 | 0 largefiles updated, 0 removed |
|
316 | 336 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
317 | 337 | (branch merge, don't forget to commit) |
|
318 | 338 | $ cat f |
|
319 | 339 | normal |
|
320 | 340 | |
|
321 | 341 | swap |
|
322 | 342 | |
|
323 | 343 | $ hg up -Cqr normal |
|
324 |
$ hg merge -r large |
|
|
344 | $ hg merge -r large-id | |
|
325 | 345 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
326 | 346 | (branch merge, don't forget to commit) |
|
327 | 347 | $ cat f |
|
328 | 348 | normal |
|
329 | 349 | |
|
330 | 350 | Ancestor: large Parent: large2 Parent: normal result: ? |
|
331 | 351 | (annoying extra prompt ... but it do not do any serious harm) |
|
332 | 352 | |
|
333 | 353 | $ hg up -Cqr large2 |
|
334 | 354 | $ hg merge -r normal |
|
335 | 355 | local changed .hglf/f which remote deleted |
|
336 | 356 | use (c)hanged version or (d)elete? c |
|
337 | 357 | remote turned local largefile f into a normal file |
|
338 | 358 | keep (l)argefile or use (n)ormal file? l |
|
339 | 359 | getting changed largefiles |
|
340 | 360 | 1 largefiles updated, 0 removed |
|
341 | 361 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
342 | 362 | (branch merge, don't forget to commit) |
|
343 | 363 | $ cat f |
|
344 | 364 | large2 |
|
345 | 365 | |
|
346 | 366 | $ hg up -Cqr large2 |
|
347 | 367 | $ echo d | hg merge -r normal --config ui.interactive=Yes |
|
348 | 368 | local changed .hglf/f which remote deleted |
|
349 | 369 | use (c)hanged version or (d)elete? d |
|
350 | 370 | getting changed largefiles |
|
351 | 371 | 0 largefiles updated, 0 removed |
|
352 | 372 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
353 | 373 | (branch merge, don't forget to commit) |
|
354 | 374 | $ cat f |
|
355 | 375 | normal |
|
356 | 376 | |
|
357 | 377 | swap |
|
358 | 378 | |
|
359 | 379 | $ hg up -Cqr normal |
|
360 | 380 | $ hg merge -r large2 |
|
361 | 381 | remote changed .hglf/f which local deleted |
|
362 | 382 | use (c)hanged version or leave (d)eleted? c |
|
363 | 383 | remote turned local normal file f into a largefile |
|
364 | 384 | use (l)argefile or keep (n)ormal file? l |
|
365 | 385 | getting changed largefiles |
|
366 | 386 | 1 largefiles updated, 0 removed |
|
367 | 387 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
368 | 388 | (branch merge, don't forget to commit) |
|
369 | 389 | $ cat f |
|
370 | 390 | large2 |
|
371 | 391 | |
|
372 | 392 | $ hg up -Cqr normal |
|
373 | 393 | $ echo d | hg merge -r large2 --config ui.interactive=Yes |
|
374 | 394 | remote changed .hglf/f which local deleted |
|
375 | 395 | use (c)hanged version or leave (d)eleted? d |
|
376 | 396 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
377 | 397 | (branch merge, don't forget to commit) |
|
378 | 398 | $ cat f |
|
379 | 399 | normal |
|
380 | 400 | |
|
381 | 401 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now