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