##// END OF EJS Templates
sidedatacopies: introduce a sidedata testcase for test-copies.t...
marmoute -
r43409:f78ad4ca default
parent child Browse files
Show More
@@ -1,598 +1,607 b''
1 #testcases filelog compatibility changeset
1 #testcases filelog compatibility changeset sidedata
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > rebase=
5 > rebase=
6 > [alias]
6 > [alias]
7 > l = log -G -T '{rev} {desc}\n{files}\n'
7 > l = log -G -T '{rev} {desc}\n{files}\n'
8 > EOF
8 > EOF
9
9
10 #if compatibility
10 #if compatibility
11 $ cat >> $HGRCPATH << EOF
11 $ cat >> $HGRCPATH << EOF
12 > [experimental]
12 > [experimental]
13 > copies.read-from = compatibility
13 > copies.read-from = compatibility
14 > EOF
14 > EOF
15 #endif
15 #endif
16
16
17 #if changeset
17 #if changeset
18 $ cat >> $HGRCPATH << EOF
18 $ cat >> $HGRCPATH << EOF
19 > [experimental]
19 > [experimental]
20 > copies.read-from = changeset-only
20 > copies.read-from = changeset-only
21 > copies.write-to = changeset-only
21 > copies.write-to = changeset-only
22 > EOF
22 > EOF
23 #endif
23 #endif
24
24
25 #if sidedata
26 $ cat >> $HGRCPATH << EOF
27 > [format]
28 > exp-use-copies-side-data-changeset = yes
29 > EOF
30 #endif
31
25 $ REPONUM=0
32 $ REPONUM=0
26 $ newrepo() {
33 $ newrepo() {
27 > cd $TESTTMP
34 > cd $TESTTMP
28 > REPONUM=`expr $REPONUM + 1`
35 > REPONUM=`expr $REPONUM + 1`
29 > hg init repo-$REPONUM
36 > hg init repo-$REPONUM
30 > cd repo-$REPONUM
37 > cd repo-$REPONUM
31 > }
38 > }
32
39
33 Simple rename case
40 Simple rename case
34 $ newrepo
41 $ newrepo
35 $ echo x > x
42 $ echo x > x
36 $ hg ci -Aqm 'add x'
43 $ hg ci -Aqm 'add x'
37 $ hg mv x y
44 $ hg mv x y
38 $ hg debugp1copies
45 $ hg debugp1copies
39 x -> y
46 x -> y
40 $ hg debugp2copies
47 $ hg debugp2copies
41 $ hg ci -m 'rename x to y'
48 $ hg ci -m 'rename x to y'
42 $ hg l
49 $ hg l
43 @ 1 rename x to y
50 @ 1 rename x to y
44 | x y
51 | x y
45 o 0 add x
52 o 0 add x
46 x
53 x
47 $ hg debugp1copies -r 1
54 $ hg debugp1copies -r 1
48 x -> y
55 x -> y
49 $ hg debugpathcopies 0 1
56 $ hg debugpathcopies 0 1
50 x -> y
57 x -> y
51 $ hg debugpathcopies 1 0
58 $ hg debugpathcopies 1 0
52 y -> x
59 y -> x
53 Test filtering copies by path. We do filtering by destination.
60 Test filtering copies by path. We do filtering by destination.
54 $ hg debugpathcopies 0 1 x
61 $ hg debugpathcopies 0 1 x
55 $ hg debugpathcopies 1 0 x
62 $ hg debugpathcopies 1 0 x
56 y -> x
63 y -> x
57 $ hg debugpathcopies 0 1 y
64 $ hg debugpathcopies 0 1 y
58 x -> y
65 x -> y
59 $ hg debugpathcopies 1 0 y
66 $ hg debugpathcopies 1 0 y
60
67
61 Copies not including commit changes
68 Copies not including commit changes
62 $ newrepo
69 $ newrepo
63 $ echo x > x
70 $ echo x > x
64 $ hg ci -Aqm 'add x'
71 $ hg ci -Aqm 'add x'
65 $ hg mv x y
72 $ hg mv x y
66 $ hg debugpathcopies . .
73 $ hg debugpathcopies . .
67 $ hg debugpathcopies . 'wdir()'
74 $ hg debugpathcopies . 'wdir()'
68 x -> y
75 x -> y
69 $ hg debugpathcopies 'wdir()' .
76 $ hg debugpathcopies 'wdir()' .
70 y -> x
77 y -> x
71
78
72 Copy a file onto another file
79 Copy a file onto another file
73 $ newrepo
80 $ newrepo
74 $ echo x > x
81 $ echo x > x
75 $ echo y > y
82 $ echo y > y
76 $ hg ci -Aqm 'add x and y'
83 $ hg ci -Aqm 'add x and y'
77 $ hg cp -f x y
84 $ hg cp -f x y
78 $ hg debugp1copies
85 $ hg debugp1copies
79 x -> y
86 x -> y
80 $ hg debugp2copies
87 $ hg debugp2copies
81 $ hg ci -m 'copy x onto y'
88 $ hg ci -m 'copy x onto y'
82 $ hg l
89 $ hg l
83 @ 1 copy x onto y
90 @ 1 copy x onto y
84 | y
91 | y
85 o 0 add x and y
92 o 0 add x and y
86 x y
93 x y
87 $ hg debugp1copies -r 1
94 $ hg debugp1copies -r 1
88 x -> y
95 x -> y
89 Incorrectly doesn't show the rename
96 Incorrectly doesn't show the rename
90 $ hg debugpathcopies 0 1
97 $ hg debugpathcopies 0 1
91
98
92 Copy a file onto another file with same content. If metadata is stored in changeset, this does not
99 Copy a file onto another file with same content. If metadata is stored in changeset, this does not
93 produce a new filelog entry. The changeset's "files" entry should still list the file.
100 produce a new filelog entry. The changeset's "files" entry should still list the file.
94 $ newrepo
101 $ newrepo
95 $ echo x > x
102 $ echo x > x
96 $ echo x > x2
103 $ echo x > x2
97 $ hg ci -Aqm 'add x and x2 with same content'
104 $ hg ci -Aqm 'add x and x2 with same content'
98 $ hg cp -f x x2
105 $ hg cp -f x x2
99 $ hg ci -m 'copy x onto x2'
106 $ hg ci -m 'copy x onto x2'
100 $ hg l
107 $ hg l
101 @ 1 copy x onto x2
108 @ 1 copy x onto x2
102 | x2
109 | x2
103 o 0 add x and x2 with same content
110 o 0 add x and x2 with same content
104 x x2
111 x x2
105 $ hg debugp1copies -r 1
112 $ hg debugp1copies -r 1
106 x -> x2
113 x -> x2
107 Incorrectly doesn't show the rename
114 Incorrectly doesn't show the rename
108 $ hg debugpathcopies 0 1
115 $ hg debugpathcopies 0 1
109
116
110 Rename file in a loop: x->y->z->x
117 Rename file in a loop: x->y->z->x
111 $ newrepo
118 $ newrepo
112 $ echo x > x
119 $ echo x > x
113 $ hg ci -Aqm 'add x'
120 $ hg ci -Aqm 'add x'
114 $ hg mv x y
121 $ hg mv x y
115 $ hg debugp1copies
122 $ hg debugp1copies
116 x -> y
123 x -> y
117 $ hg debugp2copies
124 $ hg debugp2copies
118 $ hg ci -m 'rename x to y'
125 $ hg ci -m 'rename x to y'
119 $ hg mv y z
126 $ hg mv y z
120 $ hg ci -m 'rename y to z'
127 $ hg ci -m 'rename y to z'
121 $ hg mv z x
128 $ hg mv z x
122 $ hg ci -m 'rename z to x'
129 $ hg ci -m 'rename z to x'
123 $ hg l
130 $ hg l
124 @ 3 rename z to x
131 @ 3 rename z to x
125 | x z
132 | x z
126 o 2 rename y to z
133 o 2 rename y to z
127 | y z
134 | y z
128 o 1 rename x to y
135 o 1 rename x to y
129 | x y
136 | x y
130 o 0 add x
137 o 0 add x
131 x
138 x
132 $ hg debugpathcopies 0 3
139 $ hg debugpathcopies 0 3
133
140
134 Copy x to z, then remove z, then copy x2 (same content as x) to z. With copy metadata in the
141 Copy x to z, then remove z, then copy x2 (same content as x) to z. With copy metadata in the
135 changeset, the two copies here will have the same filelog entry, so ctx['z'].introrev() might point
142 changeset, the two copies here will have the same filelog entry, so ctx['z'].introrev() might point
136 to the first commit that added the file. We should still report the copy as being from x2.
143 to the first commit that added the file. We should still report the copy as being from x2.
137 $ newrepo
144 $ newrepo
138 $ echo x > x
145 $ echo x > x
139 $ echo x > x2
146 $ echo x > x2
140 $ hg ci -Aqm 'add x and x2 with same content'
147 $ hg ci -Aqm 'add x and x2 with same content'
141 $ hg cp x z
148 $ hg cp x z
142 $ hg ci -qm 'copy x to z'
149 $ hg ci -qm 'copy x to z'
143 $ hg rm z
150 $ hg rm z
144 $ hg ci -m 'remove z'
151 $ hg ci -m 'remove z'
145 $ hg cp x2 z
152 $ hg cp x2 z
146 $ hg ci -m 'copy x2 to z'
153 $ hg ci -m 'copy x2 to z'
147 $ hg l
154 $ hg l
148 @ 3 copy x2 to z
155 @ 3 copy x2 to z
149 | z
156 | z
150 o 2 remove z
157 o 2 remove z
151 | z
158 | z
152 o 1 copy x to z
159 o 1 copy x to z
153 | z
160 | z
154 o 0 add x and x2 with same content
161 o 0 add x and x2 with same content
155 x x2
162 x x2
156 $ hg debugp1copies -r 3
163 $ hg debugp1copies -r 3
157 x2 -> z
164 x2 -> z
158 $ hg debugpathcopies 0 3
165 $ hg debugpathcopies 0 3
159 x2 -> z
166 x2 -> z
160
167
161 Create x and y, then rename them both to the same name, but on different sides of a fork
168 Create x and y, then rename them both to the same name, but on different sides of a fork
162 $ newrepo
169 $ newrepo
163 $ echo x > x
170 $ echo x > x
164 $ echo y > y
171 $ echo y > y
165 $ hg ci -Aqm 'add x and y'
172 $ hg ci -Aqm 'add x and y'
166 $ hg mv x z
173 $ hg mv x z
167 $ hg ci -qm 'rename x to z'
174 $ hg ci -qm 'rename x to z'
168 $ hg co -q 0
175 $ hg co -q 0
169 $ hg mv y z
176 $ hg mv y z
170 $ hg ci -qm 'rename y to z'
177 $ hg ci -qm 'rename y to z'
171 $ hg l
178 $ hg l
172 @ 2 rename y to z
179 @ 2 rename y to z
173 | y z
180 | y z
174 | o 1 rename x to z
181 | o 1 rename x to z
175 |/ x z
182 |/ x z
176 o 0 add x and y
183 o 0 add x and y
177 x y
184 x y
178 $ hg debugpathcopies 1 2
185 $ hg debugpathcopies 1 2
179 z -> x
186 z -> x
180 y -> z
187 y -> z
181
188
182 Fork renames x to y on one side and removes x on the other
189 Fork renames x to y on one side and removes x on the other
183 $ newrepo
190 $ newrepo
184 $ echo x > x
191 $ echo x > x
185 $ hg ci -Aqm 'add x'
192 $ hg ci -Aqm 'add x'
186 $ hg mv x y
193 $ hg mv x y
187 $ hg ci -m 'rename x to y'
194 $ hg ci -m 'rename x to y'
188 $ hg co -q 0
195 $ hg co -q 0
189 $ hg rm x
196 $ hg rm x
190 $ hg ci -m 'remove x'
197 $ hg ci -m 'remove x'
191 created new head
198 created new head
192 $ hg l
199 $ hg l
193 @ 2 remove x
200 @ 2 remove x
194 | x
201 | x
195 | o 1 rename x to y
202 | o 1 rename x to y
196 |/ x y
203 |/ x y
197 o 0 add x
204 o 0 add x
198 x
205 x
199 $ hg debugpathcopies 1 2
206 $ hg debugpathcopies 1 2
200
207
201 Merge rename from other branch
208 Merge rename from other branch
202 $ newrepo
209 $ newrepo
203 $ echo x > x
210 $ echo x > x
204 $ hg ci -Aqm 'add x'
211 $ hg ci -Aqm 'add x'
205 $ hg mv x y
212 $ hg mv x y
206 $ hg ci -m 'rename x to y'
213 $ hg ci -m 'rename x to y'
207 $ hg co -q 0
214 $ hg co -q 0
208 $ echo z > z
215 $ echo z > z
209 $ hg ci -Aqm 'add z'
216 $ hg ci -Aqm 'add z'
210 $ hg merge -q 1
217 $ hg merge -q 1
211 $ hg debugp1copies
218 $ hg debugp1copies
212 $ hg debugp2copies
219 $ hg debugp2copies
213 $ hg ci -m 'merge rename from p2'
220 $ hg ci -m 'merge rename from p2'
214 $ hg l
221 $ hg l
215 @ 3 merge rename from p2
222 @ 3 merge rename from p2
216 |\
223 |\
217 | o 2 add z
224 | o 2 add z
218 | | z
225 | | z
219 o | 1 rename x to y
226 o | 1 rename x to y
220 |/ x y
227 |/ x y
221 o 0 add x
228 o 0 add x
222 x
229 x
223 Perhaps we should indicate the rename here, but `hg status` is documented to be weird during
230 Perhaps we should indicate the rename here, but `hg status` is documented to be weird during
224 merges, so...
231 merges, so...
225 $ hg debugp1copies -r 3
232 $ hg debugp1copies -r 3
226 $ hg debugp2copies -r 3
233 $ hg debugp2copies -r 3
227 $ hg debugpathcopies 0 3
234 $ hg debugpathcopies 0 3
228 x -> y
235 x -> y
229 $ hg debugpathcopies 1 2
236 $ hg debugpathcopies 1 2
230 y -> x
237 y -> x
231 $ hg debugpathcopies 1 3
238 $ hg debugpathcopies 1 3
232 $ hg debugpathcopies 2 3
239 $ hg debugpathcopies 2 3
233 x -> y
240 x -> y
234
241
235 Copy file from either side in a merge
242 Copy file from either side in a merge
236 $ newrepo
243 $ newrepo
237 $ echo x > x
244 $ echo x > x
238 $ hg ci -Aqm 'add x'
245 $ hg ci -Aqm 'add x'
239 $ hg co -q null
246 $ hg co -q null
240 $ echo y > y
247 $ echo y > y
241 $ hg ci -Aqm 'add y'
248 $ hg ci -Aqm 'add y'
242 $ hg merge -q 0
249 $ hg merge -q 0
243 $ hg cp y z
250 $ hg cp y z
244 $ hg debugp1copies
251 $ hg debugp1copies
245 y -> z
252 y -> z
246 $ hg debugp2copies
253 $ hg debugp2copies
247 $ hg ci -m 'copy file from p1 in merge'
254 $ hg ci -m 'copy file from p1 in merge'
248 $ hg co -q 1
255 $ hg co -q 1
249 $ hg merge -q 0
256 $ hg merge -q 0
250 $ hg cp x z
257 $ hg cp x z
251 $ hg debugp1copies
258 $ hg debugp1copies
252 $ hg debugp2copies
259 $ hg debugp2copies
253 x -> z
260 x -> z
254 $ hg ci -qm 'copy file from p2 in merge'
261 $ hg ci -qm 'copy file from p2 in merge'
255 $ hg l
262 $ hg l
256 @ 3 copy file from p2 in merge
263 @ 3 copy file from p2 in merge
257 |\ z
264 |\ z
258 +---o 2 copy file from p1 in merge
265 +---o 2 copy file from p1 in merge
259 | |/ z
266 | |/ z
260 | o 1 add y
267 | o 1 add y
261 | y
268 | y
262 o 0 add x
269 o 0 add x
263 x
270 x
264 $ hg debugp1copies -r 2
271 $ hg debugp1copies -r 2
265 y -> z
272 y -> z
266 $ hg debugp2copies -r 2
273 $ hg debugp2copies -r 2
267 $ hg debugpathcopies 1 2
274 $ hg debugpathcopies 1 2
268 y -> z
275 y -> z
269 $ hg debugpathcopies 0 2
276 $ hg debugpathcopies 0 2
270 $ hg debugp1copies -r 3
277 $ hg debugp1copies -r 3
271 $ hg debugp2copies -r 3
278 $ hg debugp2copies -r 3
272 x -> z
279 x -> z
273 $ hg debugpathcopies 1 3
280 $ hg debugpathcopies 1 3
274 $ hg debugpathcopies 0 3
281 $ hg debugpathcopies 0 3
275 x -> z
282 x -> z
276
283
277 Copy file that exists on both sides of the merge, same content on both sides
284 Copy file that exists on both sides of the merge, same content on both sides
278 $ newrepo
285 $ newrepo
279 $ echo x > x
286 $ echo x > x
280 $ hg ci -Aqm 'add x on branch 1'
287 $ hg ci -Aqm 'add x on branch 1'
281 $ hg co -q null
288 $ hg co -q null
282 $ echo x > x
289 $ echo x > x
283 $ hg ci -Aqm 'add x on branch 2'
290 $ hg ci -Aqm 'add x on branch 2'
284 $ hg merge -q 0
291 $ hg merge -q 0
285 $ hg cp x z
292 $ hg cp x z
286 $ hg debugp1copies
293 $ hg debugp1copies
287 x -> z
294 x -> z
288 $ hg debugp2copies
295 $ hg debugp2copies
289 $ hg ci -qm 'merge'
296 $ hg ci -qm 'merge'
290 $ hg l
297 $ hg l
291 @ 2 merge
298 @ 2 merge
292 |\ z
299 |\ z
293 | o 1 add x on branch 2
300 | o 1 add x on branch 2
294 | x
301 | x
295 o 0 add x on branch 1
302 o 0 add x on branch 1
296 x
303 x
297 $ hg debugp1copies -r 2
304 $ hg debugp1copies -r 2
298 x -> z
305 x -> z
299 $ hg debugp2copies -r 2
306 $ hg debugp2copies -r 2
300 It's a little weird that it shows up on both sides
307 It's a little weird that it shows up on both sides
301 $ hg debugpathcopies 1 2
308 $ hg debugpathcopies 1 2
302 x -> z
309 x -> z
303 $ hg debugpathcopies 0 2
310 $ hg debugpathcopies 0 2
304 x -> z (filelog !)
311 x -> z (filelog !)
312 x -> z (sidedata !)
305
313
306 Copy file that exists on both sides of the merge, different content
314 Copy file that exists on both sides of the merge, different content
307 $ newrepo
315 $ newrepo
308 $ echo branch1 > x
316 $ echo branch1 > x
309 $ hg ci -Aqm 'add x on branch 1'
317 $ hg ci -Aqm 'add x on branch 1'
310 $ hg co -q null
318 $ hg co -q null
311 $ echo branch2 > x
319 $ echo branch2 > x
312 $ hg ci -Aqm 'add x on branch 2'
320 $ hg ci -Aqm 'add x on branch 2'
313 $ hg merge -q 0
321 $ hg merge -q 0
314 warning: conflicts while merging x! (edit, then use 'hg resolve --mark')
322 warning: conflicts while merging x! (edit, then use 'hg resolve --mark')
315 [1]
323 [1]
316 $ echo resolved > x
324 $ echo resolved > x
317 $ hg resolve -m x
325 $ hg resolve -m x
318 (no more unresolved files)
326 (no more unresolved files)
319 $ hg cp x z
327 $ hg cp x z
320 $ hg debugp1copies
328 $ hg debugp1copies
321 x -> z
329 x -> z
322 $ hg debugp2copies
330 $ hg debugp2copies
323 $ hg ci -qm 'merge'
331 $ hg ci -qm 'merge'
324 $ hg l
332 $ hg l
325 @ 2 merge
333 @ 2 merge
326 |\ x z
334 |\ x z
327 | o 1 add x on branch 2
335 | o 1 add x on branch 2
328 | x
336 | x
329 o 0 add x on branch 1
337 o 0 add x on branch 1
330 x
338 x
331 $ hg debugp1copies -r 2
339 $ hg debugp1copies -r 2
332 x -> z (changeset !)
340 x -> z (changeset !)
333 $ hg debugp2copies -r 2
341 $ hg debugp2copies -r 2
334 x -> z (no-changeset !)
342 x -> z (no-changeset !)
335 $ hg debugpathcopies 1 2
343 $ hg debugpathcopies 1 2
336 x -> z (changeset !)
344 x -> z (changeset !)
337 $ hg debugpathcopies 0 2
345 $ hg debugpathcopies 0 2
338 x -> z (no-changeset !)
346 x -> z (no-changeset !)
339
347
340 Copy x->y on one side of merge and copy x->z on the other side. Pathcopies from one parent
348 Copy x->y on one side of merge and copy x->z on the other side. Pathcopies from one parent
341 of the merge to the merge should include the copy from the other side.
349 of the merge to the merge should include the copy from the other side.
342 $ newrepo
350 $ newrepo
343 $ echo x > x
351 $ echo x > x
344 $ hg ci -Aqm 'add x'
352 $ hg ci -Aqm 'add x'
345 $ hg cp x y
353 $ hg cp x y
346 $ hg ci -qm 'copy x to y'
354 $ hg ci -qm 'copy x to y'
347 $ hg co -q 0
355 $ hg co -q 0
348 $ hg cp x z
356 $ hg cp x z
349 $ hg ci -qm 'copy x to z'
357 $ hg ci -qm 'copy x to z'
350 $ hg merge -q 1
358 $ hg merge -q 1
351 $ hg ci -m 'merge copy x->y and copy x->z'
359 $ hg ci -m 'merge copy x->y and copy x->z'
352 $ hg l
360 $ hg l
353 @ 3 merge copy x->y and copy x->z
361 @ 3 merge copy x->y and copy x->z
354 |\
362 |\
355 | o 2 copy x to z
363 | o 2 copy x to z
356 | | z
364 | | z
357 o | 1 copy x to y
365 o | 1 copy x to y
358 |/ y
366 |/ y
359 o 0 add x
367 o 0 add x
360 x
368 x
361 $ hg debugp1copies -r 3
369 $ hg debugp1copies -r 3
362 $ hg debugp2copies -r 3
370 $ hg debugp2copies -r 3
363 $ hg debugpathcopies 2 3
371 $ hg debugpathcopies 2 3
364 x -> y
372 x -> y
365 $ hg debugpathcopies 1 3
373 $ hg debugpathcopies 1 3
366 x -> z
374 x -> z
367
375
368 Copy x to y on one side of merge, create y and rename to z on the other side.
376 Copy x to y on one side of merge, create y and rename to z on the other side.
369 $ newrepo
377 $ newrepo
370 $ echo x > x
378 $ echo x > x
371 $ hg ci -Aqm 'add x'
379 $ hg ci -Aqm 'add x'
372 $ hg cp x y
380 $ hg cp x y
373 $ hg ci -qm 'copy x to y'
381 $ hg ci -qm 'copy x to y'
374 $ hg co -q 0
382 $ hg co -q 0
375 $ echo y > y
383 $ echo y > y
376 $ hg ci -Aqm 'add y'
384 $ hg ci -Aqm 'add y'
377 $ hg mv y z
385 $ hg mv y z
378 $ hg ci -m 'rename y to z'
386 $ hg ci -m 'rename y to z'
379 $ hg merge -q 1
387 $ hg merge -q 1
380 $ hg ci -m 'merge'
388 $ hg ci -m 'merge'
381 $ hg l
389 $ hg l
382 @ 4 merge
390 @ 4 merge
383 |\
391 |\
384 | o 3 rename y to z
392 | o 3 rename y to z
385 | | y z
393 | | y z
386 | o 2 add y
394 | o 2 add y
387 | | y
395 | | y
388 o | 1 copy x to y
396 o | 1 copy x to y
389 |/ y
397 |/ y
390 o 0 add x
398 o 0 add x
391 x
399 x
392 $ hg debugp1copies -r 3
400 $ hg debugp1copies -r 3
393 y -> z
401 y -> z
394 $ hg debugp2copies -r 3
402 $ hg debugp2copies -r 3
395 $ hg debugpathcopies 2 3
403 $ hg debugpathcopies 2 3
396 y -> z
404 y -> z
397 $ hg debugpathcopies 1 3
405 $ hg debugpathcopies 1 3
398 y -> z (no-filelog !)
406 y -> z (no-filelog no-sidedata !)
399
407
400 Create x and y, then rename x to z on one side of merge, and rename y to z and
408 Create x and y, then rename x to z on one side of merge, and rename y to z and
401 modify z on the other side. When storing copies in the changeset, we don't
409 modify z on the other side. When storing copies in the changeset, we don't
402 filter out copies whose target was created on the other side of the merge.
410 filter out copies whose target was created on the other side of the merge.
403 $ newrepo
411 $ newrepo
404 $ echo x > x
412 $ echo x > x
405 $ echo y > y
413 $ echo y > y
406 $ hg ci -Aqm 'add x and y'
414 $ hg ci -Aqm 'add x and y'
407 $ hg mv x z
415 $ hg mv x z
408 $ hg ci -qm 'rename x to z'
416 $ hg ci -qm 'rename x to z'
409 $ hg co -q 0
417 $ hg co -q 0
410 $ hg mv y z
418 $ hg mv y z
411 $ hg ci -qm 'rename y to z'
419 $ hg ci -qm 'rename y to z'
412 $ echo z >> z
420 $ echo z >> z
413 $ hg ci -m 'modify z'
421 $ hg ci -m 'modify z'
414 $ hg merge -q 1
422 $ hg merge -q 1
415 warning: conflicts while merging z! (edit, then use 'hg resolve --mark')
423 warning: conflicts while merging z! (edit, then use 'hg resolve --mark')
416 [1]
424 [1]
417 $ echo z > z
425 $ echo z > z
418 $ hg resolve -qm z
426 $ hg resolve -qm z
419 $ hg ci -m 'merge 1 into 3'
427 $ hg ci -m 'merge 1 into 3'
420 Try merging the other direction too
428 Try merging the other direction too
421 $ hg co -q 1
429 $ hg co -q 1
422 $ hg merge -q 3
430 $ hg merge -q 3
423 warning: conflicts while merging z! (edit, then use 'hg resolve --mark')
431 warning: conflicts while merging z! (edit, then use 'hg resolve --mark')
424 [1]
432 [1]
425 $ echo z > z
433 $ echo z > z
426 $ hg resolve -qm z
434 $ hg resolve -qm z
427 $ hg ci -m 'merge 3 into 1'
435 $ hg ci -m 'merge 3 into 1'
428 created new head
436 created new head
429 $ hg l
437 $ hg l
430 @ 5 merge 3 into 1
438 @ 5 merge 3 into 1
431 |\ z
439 |\ z
432 +---o 4 merge 1 into 3
440 +---o 4 merge 1 into 3
433 | |/ z
441 | |/ z
434 | o 3 modify z
442 | o 3 modify z
435 | | z
443 | | z
436 | o 2 rename y to z
444 | o 2 rename y to z
437 | | y z
445 | | y z
438 o | 1 rename x to z
446 o | 1 rename x to z
439 |/ x z
447 |/ x z
440 o 0 add x and y
448 o 0 add x and y
441 x y
449 x y
442 $ hg debugpathcopies 1 4
450 $ hg debugpathcopies 1 4
443 y -> z (no-filelog !)
451 y -> z (no-filelog no-sidedata !)
444 $ hg debugpathcopies 2 4
452 $ hg debugpathcopies 2 4
445 x -> z (no-filelog !)
453 x -> z (no-filelog no-sidedata !)
446 $ hg debugpathcopies 0 4
454 $ hg debugpathcopies 0 4
447 x -> z (filelog !)
455 x -> z (filelog !)
456 x -> z (sidedata !)
448 y -> z (compatibility !)
457 y -> z (compatibility !)
449 y -> z (changeset !)
458 y -> z (changeset !)
450 $ hg debugpathcopies 1 5
459 $ hg debugpathcopies 1 5
451 y -> z (no-filelog !)
460 y -> z (no-filelog no-sidedata !)
452 $ hg debugpathcopies 2 5
461 $ hg debugpathcopies 2 5
453 x -> z (no-filelog !)
462 x -> z (no-filelog no-sidedata !)
454 $ hg debugpathcopies 0 5
463 $ hg debugpathcopies 0 5
455 x -> z
464 x -> z
456
465
457
466
458 Test for a case in fullcopytracing algorithm where neither of the merging csets
467 Test for a case in fullcopytracing algorithm where neither of the merging csets
459 is a descendant of the merge base. This test reflects that the algorithm
468 is a descendant of the merge base. This test reflects that the algorithm
460 correctly finds the copies:
469 correctly finds the copies:
461
470
462 $ cat >> $HGRCPATH << EOF
471 $ cat >> $HGRCPATH << EOF
463 > [experimental]
472 > [experimental]
464 > evolution.createmarkers=True
473 > evolution.createmarkers=True
465 > evolution.allowunstable=True
474 > evolution.allowunstable=True
466 > EOF
475 > EOF
467
476
468 $ newrepo
477 $ newrepo
469 $ echo a > a
478 $ echo a > a
470 $ hg add a
479 $ hg add a
471 $ hg ci -m "added a"
480 $ hg ci -m "added a"
472 $ echo b > b
481 $ echo b > b
473 $ hg add b
482 $ hg add b
474 $ hg ci -m "added b"
483 $ hg ci -m "added b"
475
484
476 $ hg mv b b1
485 $ hg mv b b1
477 $ hg ci -m "rename b to b1"
486 $ hg ci -m "rename b to b1"
478
487
479 $ hg up ".^"
488 $ hg up ".^"
480 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
489 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
481 $ echo d > d
490 $ echo d > d
482 $ hg add d
491 $ hg add d
483 $ hg ci -m "added d"
492 $ hg ci -m "added d"
484 created new head
493 created new head
485
494
486 $ echo baba >> b
495 $ echo baba >> b
487 $ hg ci --amend -m "added d, modified b"
496 $ hg ci --amend -m "added d, modified b"
488
497
489 $ hg l --hidden
498 $ hg l --hidden
490 @ 4 added d, modified b
499 @ 4 added d, modified b
491 | b d
500 | b d
492 | x 3 added d
501 | x 3 added d
493 |/ d
502 |/ d
494 | o 2 rename b to b1
503 | o 2 rename b to b1
495 |/ b b1
504 |/ b b1
496 o 1 added b
505 o 1 added b
497 | b
506 | b
498 o 0 added a
507 o 0 added a
499 a
508 a
500
509
501 Grafting revision 4 on top of revision 2, showing that it respect the rename:
510 Grafting revision 4 on top of revision 2, showing that it respect the rename:
502
511
503 $ hg up 2 -q
512 $ hg up 2 -q
504 $ hg graft -r 4 --base 3 --hidden
513 $ hg graft -r 4 --base 3 --hidden
505 grafting 4:af28412ec03c "added d, modified b" (tip) (no-changeset !)
514 grafting 4:af28412ec03c "added d, modified b" (tip) (no-changeset !)
506 grafting 4:6325ca0b7a1c "added d, modified b" (tip) (changeset !)
515 grafting 4:6325ca0b7a1c "added d, modified b" (tip) (changeset !)
507 merging b1 and b to b1
516 merging b1 and b to b1
508
517
509 $ hg l -l1 -p
518 $ hg l -l1 -p
510 @ 5 added d, modified b
519 @ 5 added d, modified b
511 | b1
520 | b1
512 ~ diff -r 5a4825cc2926 -r 94a2f1a0e8e2 b1 (no-changeset !)
521 ~ diff -r 5a4825cc2926 -r 94a2f1a0e8e2 b1 (no-changeset !)
513 ~ diff -r 0a0ed3b3251c -r d544fb655520 b1 (changeset !)
522 ~ diff -r 0a0ed3b3251c -r d544fb655520 b1 (changeset !)
514 --- a/b1 Thu Jan 01 00:00:00 1970 +0000
523 --- a/b1 Thu Jan 01 00:00:00 1970 +0000
515 +++ b/b1 Thu Jan 01 00:00:00 1970 +0000
524 +++ b/b1 Thu Jan 01 00:00:00 1970 +0000
516 @@ -1,1 +1,2 @@
525 @@ -1,1 +1,2 @@
517 b
526 b
518 +baba
527 +baba
519
528
520 Test to make sure that fullcopytracing algorithm doesn't fail when neither of the
529 Test to make sure that fullcopytracing algorithm doesn't fail when neither of the
521 merging csets is a descendant of the base.
530 merging csets is a descendant of the base.
522 -------------------------------------------------------------------------------------------------
531 -------------------------------------------------------------------------------------------------
523
532
524 $ newrepo
533 $ newrepo
525 $ echo a > a
534 $ echo a > a
526 $ hg add a
535 $ hg add a
527 $ hg ci -m "added a"
536 $ hg ci -m "added a"
528 $ echo b > b
537 $ echo b > b
529 $ hg add b
538 $ hg add b
530 $ hg ci -m "added b"
539 $ hg ci -m "added b"
531
540
532 $ echo foobar > willconflict
541 $ echo foobar > willconflict
533 $ hg add willconflict
542 $ hg add willconflict
534 $ hg ci -m "added willconflict"
543 $ hg ci -m "added willconflict"
535 $ echo c > c
544 $ echo c > c
536 $ hg add c
545 $ hg add c
537 $ hg ci -m "added c"
546 $ hg ci -m "added c"
538
547
539 $ hg l
548 $ hg l
540 @ 3 added c
549 @ 3 added c
541 | c
550 | c
542 o 2 added willconflict
551 o 2 added willconflict
543 | willconflict
552 | willconflict
544 o 1 added b
553 o 1 added b
545 | b
554 | b
546 o 0 added a
555 o 0 added a
547 a
556 a
548
557
549 $ hg up ".^^"
558 $ hg up ".^^"
550 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
559 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
551 $ echo d > d
560 $ echo d > d
552 $ hg add d
561 $ hg add d
553 $ hg ci -m "added d"
562 $ hg ci -m "added d"
554 created new head
563 created new head
555
564
556 $ echo barfoo > willconflict
565 $ echo barfoo > willconflict
557 $ hg add willconflict
566 $ hg add willconflict
558 $ hg ci --amend -m "added willconflict and d"
567 $ hg ci --amend -m "added willconflict and d"
559
568
560 $ hg l
569 $ hg l
561 @ 5 added willconflict and d
570 @ 5 added willconflict and d
562 | d willconflict
571 | d willconflict
563 | o 3 added c
572 | o 3 added c
564 | | c
573 | | c
565 | o 2 added willconflict
574 | o 2 added willconflict
566 |/ willconflict
575 |/ willconflict
567 o 1 added b
576 o 1 added b
568 | b
577 | b
569 o 0 added a
578 o 0 added a
570 a
579 a
571
580
572 $ hg rebase -r . -d 2 -t :other
581 $ hg rebase -r . -d 2 -t :other
573 rebasing 5:5018b1509e94 "added willconflict and d" (tip) (no-changeset !)
582 rebasing 5:5018b1509e94 "added willconflict and d" (tip) (no-changeset !)
574 rebasing 5:af8d273bf580 "added willconflict and d" (tip) (changeset !)
583 rebasing 5:af8d273bf580 "added willconflict and d" (tip) (changeset !)
575
584
576 $ hg up 3 -q
585 $ hg up 3 -q
577 $ hg l --hidden
586 $ hg l --hidden
578 o 6 added willconflict and d
587 o 6 added willconflict and d
579 | d willconflict
588 | d willconflict
580 | x 5 added willconflict and d
589 | x 5 added willconflict and d
581 | | d willconflict
590 | | d willconflict
582 | | x 4 added d
591 | | x 4 added d
583 | |/ d
592 | |/ d
584 +---@ 3 added c
593 +---@ 3 added c
585 | | c
594 | | c
586 o | 2 added willconflict
595 o | 2 added willconflict
587 |/ willconflict
596 |/ willconflict
588 o 1 added b
597 o 1 added b
589 | b
598 | b
590 o 0 added a
599 o 0 added a
591 a
600 a
592
601
593 Now if we trigger a merge between revision 3 and 6 using base revision 4,
602 Now if we trigger a merge between revision 3 and 6 using base revision 4,
594 neither of the merging csets will be a descendant of the base revision:
603 neither of the merging csets will be a descendant of the base revision:
595
604
596 $ hg graft -r 6 --base 4 --hidden -t :other
605 $ hg graft -r 6 --base 4 --hidden -t :other
597 grafting 6:99802e4f1e46 "added willconflict and d" (tip) (no-changeset !)
606 grafting 6:99802e4f1e46 "added willconflict and d" (tip) (no-changeset !)
598 grafting 6:b19f0df72728 "added willconflict and d" (tip) (changeset !)
607 grafting 6:b19f0df72728 "added willconflict and d" (tip) (changeset !)
General Comments 0
You need to be logged in to leave comments. Login now