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