##// END OF EJS Templates
tests: move verification closer to setup in test-copies-chain-merge.t...
Martin von Zweigbergk -
r45169:806f1f1b default
parent child Browse files
Show More
This diff has been collapsed as it changes many lines, (504 lines changed) Show them Hide them
@@ -1,868 +1,816 b''
1 =====================================================
1 =====================================================
2 Test Copy tracing for chain of copies involving merge
2 Test Copy tracing for chain of copies involving merge
3 =====================================================
3 =====================================================
4
4
5 This test files covers copies/rename case for a chains of commit where merges
5 This test files covers copies/rename case for a chains of commit where merges
6 are involved. It cheks we do not have unwanted update of behavior and that the
6 are involved. It cheks we do not have unwanted update of behavior and that the
7 different options to retrieve copies behave correctly.
7 different options to retrieve copies behave correctly.
8
8
9 Setup
9 Setup
10 =====
10 =====
11
11
12 use git diff to see rename
12 use git diff to see rename
13
13
14 $ cat << EOF >> $HGRCPATH
14 $ cat << EOF >> $HGRCPATH
15 > [diff]
15 > [diff]
16 > git=yes
16 > git=yes
17 > [ui]
17 > [ui]
18 > logtemplate={rev} {desc}\n
18 > logtemplate={rev} {desc}\n
19 > EOF
19 > EOF
20
20
21 $ hg init repo-chain
21 $ hg init repo-chain
22 $ cd repo-chain
22 $ cd repo-chain
23
23
24 Add some linear rename initialy
24 Add some linear rename initialy
25
25
26 $ touch a b h
26 $ touch a b h
27 $ hg ci -Am 'i-0 initial commit: a b h'
27 $ hg ci -Am 'i-0 initial commit: a b h'
28 adding a
28 adding a
29 adding b
29 adding b
30 adding h
30 adding h
31 $ hg mv a c
31 $ hg mv a c
32 $ hg ci -Am 'i-1: a -move-> c'
32 $ hg ci -Am 'i-1: a -move-> c'
33 $ hg mv c d
33 $ hg mv c d
34 $ hg ci -Am 'i-2: c -move-> d'
34 $ hg ci -Am 'i-2: c -move-> d'
35 $ hg log -G
35 $ hg log -G
36 @ 2 i-2: c -move-> d
36 @ 2 i-2: c -move-> d
37 |
37 |
38 o 1 i-1: a -move-> c
38 o 1 i-1: a -move-> c
39 |
39 |
40 o 0 i-0 initial commit: a b h
40 o 0 i-0 initial commit: a b h
41
41
42
42
43 And having another branch with renames on the other side
43 And having another branch with renames on the other side
44
44
45 $ hg mv d e
45 $ hg mv d e
46 $ hg ci -Am 'a-1: d -move-> e'
46 $ hg ci -Am 'a-1: d -move-> e'
47 $ hg mv e f
47 $ hg mv e f
48 $ hg ci -Am 'a-2: e -move-> f'
48 $ hg ci -Am 'a-2: e -move-> f'
49 $ hg log -G --rev '::.'
49 $ hg log -G --rev '::.'
50 @ 4 a-2: e -move-> f
50 @ 4 a-2: e -move-> f
51 |
51 |
52 o 3 a-1: d -move-> e
52 o 3 a-1: d -move-> e
53 |
53 |
54 o 2 i-2: c -move-> d
54 o 2 i-2: c -move-> d
55 |
55 |
56 o 1 i-1: a -move-> c
56 o 1 i-1: a -move-> c
57 |
57 |
58 o 0 i-0 initial commit: a b h
58 o 0 i-0 initial commit: a b h
59
59
60
60
61 Have a branching with nothing on one side
61 Have a branching with nothing on one side
62
62
63 $ hg up 'desc("i-2")'
63 $ hg up 'desc("i-2")'
64 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
64 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
65 $ echo foo > b
65 $ echo foo > b
66 $ hg ci -m 'b-1: b update'
66 $ hg ci -m 'b-1: b update'
67 created new head
67 created new head
68 $ hg log -G --rev '::.'
68 $ hg log -G --rev '::.'
69 @ 5 b-1: b update
69 @ 5 b-1: b update
70 |
70 |
71 o 2 i-2: c -move-> d
71 o 2 i-2: c -move-> d
72 |
72 |
73 o 1 i-1: a -move-> c
73 o 1 i-1: a -move-> c
74 |
74 |
75 o 0 i-0 initial commit: a b h
75 o 0 i-0 initial commit: a b h
76
76
77
77
78 Create a branch that delete a file previous renamed
78 Create a branch that delete a file previous renamed
79
79
80 $ hg up 'desc("i-2")'
80 $ hg up 'desc("i-2")'
81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 $ hg rm d
82 $ hg rm d
83 $ hg ci -m 'c-1 delete d'
83 $ hg ci -m 'c-1 delete d'
84 created new head
84 created new head
85 $ hg log -G --rev '::.'
85 $ hg log -G --rev '::.'
86 @ 6 c-1 delete d
86 @ 6 c-1 delete d
87 |
87 |
88 o 2 i-2: c -move-> d
88 o 2 i-2: c -move-> d
89 |
89 |
90 o 1 i-1: a -move-> c
90 o 1 i-1: a -move-> c
91 |
91 |
92 o 0 i-0 initial commit: a b h
92 o 0 i-0 initial commit: a b h
93
93
94
94
95 Create a branch that delete a file previous renamed and recreate it
95 Create a branch that delete a file previous renamed and recreate it
96
96
97 $ hg up 'desc("i-2")'
97 $ hg up 'desc("i-2")'
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 $ hg rm d
99 $ hg rm d
100 $ hg ci -m 'd-1 delete d'
100 $ hg ci -m 'd-1 delete d'
101 created new head
101 created new head
102 $ echo bar > d
102 $ echo bar > d
103 $ hg add d
103 $ hg add d
104 $ hg ci -m 'd-2 re-add d'
104 $ hg ci -m 'd-2 re-add d'
105 $ hg log -G --rev '::.'
105 $ hg log -G --rev '::.'
106 @ 8 d-2 re-add d
106 @ 8 d-2 re-add d
107 |
107 |
108 o 7 d-1 delete d
108 o 7 d-1 delete d
109 |
109 |
110 o 2 i-2: c -move-> d
110 o 2 i-2: c -move-> d
111 |
111 |
112 o 1 i-1: a -move-> c
112 o 1 i-1: a -move-> c
113 |
113 |
114 o 0 i-0 initial commit: a b h
114 o 0 i-0 initial commit: a b h
115
115
116
116
117 Having another branch renaming a different file to the same filename as another
117 Having another branch renaming a different file to the same filename as another
118
118
119 $ hg up 'desc("i-2")'
119 $ hg up 'desc("i-2")'
120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 $ hg mv b g
121 $ hg mv b g
122 $ hg ci -m 'e-1 b -move-> g'
122 $ hg ci -m 'e-1 b -move-> g'
123 created new head
123 created new head
124 $ hg mv g f
124 $ hg mv g f
125 $ hg ci -m 'e-2 g -move-> f'
125 $ hg ci -m 'e-2 g -move-> f'
126 $ hg log -G --rev '::.'
126 $ hg log -G --rev '::.'
127 @ 10 e-2 g -move-> f
127 @ 10 e-2 g -move-> f
128 |
128 |
129 o 9 e-1 b -move-> g
129 o 9 e-1 b -move-> g
130 |
130 |
131 o 2 i-2: c -move-> d
131 o 2 i-2: c -move-> d
132 |
132 |
133 o 1 i-1: a -move-> c
133 o 1 i-1: a -move-> c
134 |
134 |
135 o 0 i-0 initial commit: a b h
135 o 0 i-0 initial commit: a b h
136
136
137
137
138 Merge the two branches we just defined (in both directions)
138 merging with unrelated change does not interfere with the renames
139 - one with change to an unrelated file
139 ---------------------------------------------------------------
140 - one with renames in them
140
141 - rename on one side
142 - unrelated change on the other side
141
143
142 $ hg up 'desc("b-1")'
144 $ hg up 'desc("b-1")'
143 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
145 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
144 $ hg merge 'desc("a-2")'
146 $ hg merge 'desc("a-2")'
145 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
147 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
146 (branch merge, don't forget to commit)
148 (branch merge, don't forget to commit)
147 $ hg ci -m 'mBAm-0 simple merge - one way'
149 $ hg ci -m 'mBAm-0 simple merge - one way'
148 $ hg up 'desc("a-2")'
150 $ hg up 'desc("a-2")'
149 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 $ hg merge 'desc("b-1")'
152 $ hg merge 'desc("b-1")'
151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 (branch merge, don't forget to commit)
154 (branch merge, don't forget to commit)
153 $ hg ci -m 'mABm-0 simple merge - the other way'
155 $ hg ci -m 'mABm-0 simple merge - the other way'
154 created new head
156 created new head
155 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
157 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
156 @ 12 mABm-0 simple merge - the other way
158 @ 12 mABm-0 simple merge - the other way
157 |\
159 |\
158 +---o 11 mBAm-0 simple merge - one way
160 +---o 11 mBAm-0 simple merge - one way
159 | |/
161 | |/
160 | o 5 b-1: b update
162 | o 5 b-1: b update
161 | |
163 | |
162 o | 4 a-2: e -move-> f
164 o | 4 a-2: e -move-> f
163 | |
165 | |
164 o | 3 a-1: d -move-> e
166 o | 3 a-1: d -move-> e
165 |/
167 |/
166 o 2 i-2: c -move-> d
168 o 2 i-2: c -move-> d
167 |
169 |
168 o 1 i-1: a -move-> c
170 o 1 i-1: a -move-> c
169 |
171 |
170 o 0 i-0 initial commit: a b h
172 o 0 i-0 initial commit: a b h
171
173
172
174
173 Merge:
175 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
176 A f
177 d
178 R d
179 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
180 A f
181 d
182 R d
183 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
184 M b
185 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
186 M b
187 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
188 M b
189 A f
190 d
191 R d
192 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
193 M b
194 A f
195 d
196 R d
197 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
198 M b
199 A f
200 a
201 R a
202 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
203 M b
204 A f
205 a
206 R a
207
208 merging with the side having a delete
209 -------------------------------------
210
211 case summary:
174 - one with change to an unrelated file
212 - one with change to an unrelated file
175 - one deleting the change
213 - one deleting the change
176 and recreate an unrelated file after the merge
214 and recreate an unrelated file after the merge
177
215
178 $ hg up 'desc("b-1")'
216 $ hg up 'desc("b-1")'
179 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
217 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
180 $ hg merge 'desc("c-1")'
218 $ hg merge 'desc("c-1")'
181 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
219 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
182 (branch merge, don't forget to commit)
220 (branch merge, don't forget to commit)
183 $ hg ci -m 'mBCm-0 simple merge - one way'
221 $ hg ci -m 'mBCm-0 simple merge - one way'
184 $ echo bar > d
222 $ echo bar > d
185 $ hg add d
223 $ hg add d
186 $ hg ci -m 'mBCm-1 re-add d'
224 $ hg ci -m 'mBCm-1 re-add d'
187 $ hg up 'desc("c-1")'
225 $ hg up 'desc("c-1")'
188 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
226 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
189 $ hg merge 'desc("b-1")'
227 $ hg merge 'desc("b-1")'
190 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 (branch merge, don't forget to commit)
229 (branch merge, don't forget to commit)
192 $ hg ci -m 'mCBm-0 simple merge - the other way'
230 $ hg ci -m 'mCBm-0 simple merge - the other way'
193 created new head
231 created new head
194 $ echo bar > d
232 $ echo bar > d
195 $ hg add d
233 $ hg add d
196 $ hg ci -m 'mCBm-1 re-add d'
234 $ hg ci -m 'mCBm-1 re-add d'
197 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
235 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
198 @ 16 mCBm-1 re-add d
236 @ 16 mCBm-1 re-add d
199 |
237 |
200 o 15 mCBm-0 simple merge - the other way
238 o 15 mCBm-0 simple merge - the other way
201 |\
239 |\
202 | | o 14 mBCm-1 re-add d
240 | | o 14 mBCm-1 re-add d
203 | | |
241 | | |
204 +---o 13 mBCm-0 simple merge - one way
242 +---o 13 mBCm-0 simple merge - one way
205 | |/
243 | |/
206 | o 6 c-1 delete d
244 | o 6 c-1 delete d
207 | |
245 | |
208 o | 5 b-1: b update
246 o | 5 b-1: b update
209 |/
247 |/
210 o 2 i-2: c -move-> d
248 o 2 i-2: c -move-> d
211 |
249 |
212 o 1 i-1: a -move-> c
250 o 1 i-1: a -move-> c
213 |
251 |
214 o 0 i-0 initial commit: a b h
252 o 0 i-0 initial commit: a b h
215
253
216
217 Merge:
218 - one with change to an unrelated file
219 - one deleting and recreating the file
220
221 Note:
222 | In this case, the merge get conflicting information since on one side we have
223 | a "brand new" d. and one the other one we have "d renamed from c (itself
224 | renamed from c)".
225 |
226 | The current code arbitrarily pick one side
227
228 $ hg up 'desc("b-1")'
229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
230 $ hg merge 'desc("d-2")'
231 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
232 (branch merge, don't forget to commit)
233 $ hg ci -m 'mBDm-0 simple merge - one way'
234 $ hg up 'desc("d-2")'
235 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
236 $ hg merge 'desc("b-1")'
237 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 (branch merge, don't forget to commit)
239 $ hg ci -m 'mDBm-0 simple merge - the other way'
240 created new head
241 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
242 @ 18 mDBm-0 simple merge - the other way
243 |\
244 +---o 17 mBDm-0 simple merge - one way
245 | |/
246 | o 8 d-2 re-add d
247 | |
248 | o 7 d-1 delete d
249 | |
250 o | 5 b-1: b update
251 |/
252 o 2 i-2: c -move-> d
253 |
254 o 1 i-1: a -move-> c
255 |
256 o 0 i-0 initial commit: a b h
257
258
259 Merge:
260 - the "e-" branch renaming b to f (through 'g')
261 - the "a-" branch renaming d to f (through e)
262
263 $ hg up 'desc("a-2")'
264 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
265 $ hg merge 'desc("e-2")'
266 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
267 (branch merge, don't forget to commit)
268 $ hg ci -m 'mAEm-0 simple merge - one way'
269 $ hg up 'desc("e-2")'
270 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 $ hg merge 'desc("a-2")'
272 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
273 (branch merge, don't forget to commit)
274 $ hg ci -m 'mEAm-0 simple merge - the other way'
275 created new head
276 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
277 @ 20 mEAm-0 simple merge - the other way
278 |\
279 +---o 19 mAEm-0 simple merge - one way
280 | |/
281 | o 10 e-2 g -move-> f
282 | |
283 | o 9 e-1 b -move-> g
284 | |
285 o | 4 a-2: e -move-> f
286 | |
287 o | 3 a-1: d -move-> e
288 |/
289 o 2 i-2: c -move-> d
290 |
291 o 1 i-1: a -move-> c
292 |
293 o 0 i-0 initial commit: a b h
294
295
296 Note:
297 | In this case, one of the merge wrongly record a merge while there is none.
298 | This lead to bad copy tracing information to be dug up.
299
300
301 Merge:
302 - one with change to an unrelated file (b)
303 - one overwriting a file (d) with a rename (from h to i to d)
304
305 $ hg up 'desc("i-2")'
306 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
307 $ hg mv h i
308 $ hg commit -m "f-1: rename h -> i"
309 created new head
310 $ hg mv --force i d
311 $ hg commit -m "f-2: rename i -> d"
312 $ hg debugindex d
313 rev linkrev nodeid p1 p2
314 0 2 01c2f5eabdc4 000000000000 000000000000
315 1 8 b004912a8510 000000000000 000000000000
316 2 17 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
317 3 22 c72365ee036f 000000000000 000000000000
318 $ hg up 'desc("b-1")'
319 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
320 $ hg merge 'desc("f-2")'
321 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
322 (branch merge, don't forget to commit)
323 $ hg ci -m 'mBFm-0 simple merge - one way'
324 $ hg up 'desc("f-2")'
325 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
326 $ hg merge 'desc("b-1")'
327 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
328 (branch merge, don't forget to commit)
329 $ hg ci -m 'mFBm-0 simple merge - the other way'
330 created new head
331 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
332 @ 24 mFBm-0 simple merge - the other way
333 |\
334 +---o 23 mBFm-0 simple merge - one way
335 | |/
336 | o 22 f-2: rename i -> d
337 | |
338 | o 21 f-1: rename h -> i
339 | |
340 o | 5 b-1: b update
341 |/
342 o 2 i-2: c -move-> d
343 |
344 o 1 i-1: a -move-> c
345 |
346 o 0 i-0 initial commit: a b h
347
348
349 Merge:
350 - one with change to a file
351 - one deleting and recreating the file
352
353 $ hg up 'desc("i-2")'
354 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 $ echo "some update" >> d
356 $ hg commit -m "g-1: update d"
357 created new head
358 $ hg up 'desc("d-2")'
359 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
360 $ hg merge 'desc("g-1")' --tool :union
361 merging d
362 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
363 (branch merge, don't forget to commit)
364 $ hg ci -m 'mDGm-0 simple merge - one way'
365 $ hg up 'desc("g-1")'
366 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
367 $ hg merge 'desc("d-2")' --tool :union
368 merging d
369 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
370 (branch merge, don't forget to commit)
371 $ hg ci -m 'mGDm-0 simple merge - the other way'
372 created new head
373 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
374 @ 27 mGDm-0 simple merge - the other way
375 |\
376 +---o 26 mDGm-0 simple merge - one way
377 | |/
378 | o 25 g-1: update d
379 | |
380 o | 8 d-2 re-add d
381 | |
382 o | 7 d-1 delete d
383 |/
384 o 2 i-2: c -move-> d
385 |
386 o 1 i-1: a -move-> c
387 |
388 o 0 i-0 initial commit: a b h
389
390
391
392 Merge:
393 - one with change to a file (d)
394 - one overwriting that file with a rename (from h to i, to d)
395
396 $ hg up 'desc("f-2")'
397 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
398 $ hg merge 'desc("g-1")' --tool :union
399 merging d
400 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
401 (branch merge, don't forget to commit)
402 $ hg ci -m 'mFGm-0 simple merge - one way'
403 created new head
404 $ hg up 'desc("g-1")'
405 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
406 $ hg merge 'desc("f-2")' --tool :union
407 merging d
408 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
409 (branch merge, don't forget to commit)
410 $ hg ci -m 'mGFm-0 simple merge - the other way'
411 created new head
412 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
413 @ 29 mGFm-0 simple merge - the other way
414 |\
415 +---o 28 mFGm-0 simple merge - one way
416 | |/
417 | o 25 g-1: update d
418 | |
419 o | 22 f-2: rename i -> d
420 | |
421 o | 21 f-1: rename h -> i
422 |/
423 o 2 i-2: c -move-> d
424 |
425 o 1 i-1: a -move-> c
426 |
427 o 0 i-0 initial commit: a b h
428
429
430
431 Check results
432 =============
433
434 merging with unrelated change does not interfer wit the renames
435 ---------------------------------------------------------------
436
437 - rename on one side
438 - unrelated change on the other side
439
440 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
441 A f
442 d
443 R d
444 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
445 A f
446 d
447 R d
448 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
449 M b
450 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
451 M b
452 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
453 M b
454 A f
455 d
456 R d
457 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
458 M b
459 A f
460 d
461 R d
462 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
463 M b
464 A f
465 a
466 R a
467 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
468 M b
469 A f
470 a
471 R a
472
473 merging with the side having a delete
474 -------------------------------------
475
476 case summary:
477 - one with change to an unrelated file
478 - one deleting the change
479 and recreate an unrelated file after the merge
480
481 checks:
482 - comparing from the merge
254 - comparing from the merge
483
255
484 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
256 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
485 R d
257 R d
486 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
258 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
487 R d
259 R d
488 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
260 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
489 M b
261 M b
490 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
262 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
491 M b
263 M b
492 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
264 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
493 M b
265 M b
494 R d
266 R d
495 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
267 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
496 M b
268 M b
497 R d
269 R d
498 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
270 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
499 M b
271 M b
500 R a
272 R a
501 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
273 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
502 M b
274 M b
503 R a
275 R a
504
276
505 - comparing with the merge children re-adding the file
277 - comparing with the merge children re-adding the file
506
278
507 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
279 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
508 M d
280 M d
509 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
281 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
510 M d
282 M d
511 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
283 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
512 M b
284 M b
513 A d
285 A d
514 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
286 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
515 M b
287 M b
516 A d
288 A d
517 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
289 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
518 M b
290 M b
519 M d
291 M d
520 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
292 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
521 M b
293 M b
522 M d
294 M d
523 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
295 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
524 M b
296 M b
525 A d
297 A d
526 R a
298 R a
527 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
299 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
528 M b
300 M b
529 A d
301 A d
530 R a
302 R a
531
303
532 Comparing with a merge re-adding the file afterward
304 Comparing with a merge re-adding the file afterward
533 ---------------------------------------------------
305 ---------------------------------------------------
534
306
535 Merge:
307 Merge:
536 - one with change to an unrelated file
308 - one with change to an unrelated file
537 - one deleting and recreating the change
309 - one deleting and recreating the change
538
310
539 Note:
311 Note:
540 | In this case, one of the merge wrongly record a merge while there is none.
312 | In this case, one of the merge wrongly record a merge while there is none.
541 | This lead to bad copy tracing information to be dug up.
313 | This lead to bad copy tracing information to be dug up.
542
314
315 $ hg up 'desc("b-1")'
316 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
317 $ hg merge 'desc("d-2")'
318 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
319 (branch merge, don't forget to commit)
320 $ hg ci -m 'mBDm-0 simple merge - one way'
321 $ hg up 'desc("d-2")'
322 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 $ hg merge 'desc("b-1")'
324 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
325 (branch merge, don't forget to commit)
326 $ hg ci -m 'mDBm-0 simple merge - the other way'
327 created new head
328 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
329 @ 18 mDBm-0 simple merge - the other way
330 |\
331 +---o 17 mBDm-0 simple merge - one way
332 | |/
333 | o 8 d-2 re-add d
334 | |
335 | o 7 d-1 delete d
336 | |
337 o | 5 b-1: b update
338 |/
339 o 2 i-2: c -move-> d
340 |
341 o 1 i-1: a -move-> c
342 |
343 o 0 i-0 initial commit: a b h
344
543 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
345 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
544 M d
346 M d
545 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
347 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
546 M d
348 M d
547 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
349 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
548 M b
350 M b
549 M d
351 M d
550 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
352 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
551 M b
353 M b
552 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
354 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
553 M b
355 M b
554 M d
356 M d
555 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
357 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
556 M b
358 M b
557 M d
359 M d
558
360
559 The bugs makes recorded copy is different depending of where we started the merge from since
361 The bugs makes recorded copy is different depending of where we started the merge from since
560
362
561 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
363 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
562 0bb5445dc4d02f4e0d86cf16f9f3a411d0f17744 644 d
364 0bb5445dc4d02f4e0d86cf16f9f3a411d0f17744 644 d
563 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
365 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
564 b004912a8510032a0350a74daa2803dadfb00e12 644 d
366 b004912a8510032a0350a74daa2803dadfb00e12 644 d
565
367
566 The 0bb5445dc4d02f4e0d86cf16f9f3a411d0f17744 entry is wrong, since the file was
368 The 0bb5445dc4d02f4e0d86cf16f9f3a411d0f17744 entry is wrong, since the file was
567 deleted on one side (then recreate) and untouched on the other side, no "merge"
369 deleted on one side (then recreate) and untouched on the other side, no "merge"
568 has happened. The resulting `d` file is the untouched version from branch `D`,
370 has happened. The resulting `d` file is the untouched version from branch `D`,
569 not a merge.
371 not a merge.
570
372
571 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
373 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
572 b004912a8510032a0350a74daa2803dadfb00e12 644 d
374 b004912a8510032a0350a74daa2803dadfb00e12 644 d
573 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
375 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
574 01c2f5eabdc4ce2bdee42b5f86311955e6c8f573 644 d
376 01c2f5eabdc4ce2bdee42b5f86311955e6c8f573 644 d
575 $ hg debugindex d
377 $ hg debugindex d
576 rev linkrev nodeid p1 p2
378 rev linkrev nodeid p1 p2
577 0 2 01c2f5eabdc4 000000000000 000000000000
379 0 2 01c2f5eabdc4 000000000000 000000000000
578 1 8 b004912a8510 000000000000 000000000000
380 1 8 b004912a8510 000000000000 000000000000
579 2 17 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
381 2 17 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
580 3 22 c72365ee036f 000000000000 000000000000
581 4 23 863d9bc49190 01c2f5eabdc4 c72365ee036f
582 5 25 7bded9d9da1f 01c2f5eabdc4 000000000000
583 6 26 f04cac32d703 b004912a8510 7bded9d9da1f
584 7 27 d7a5eafb9322 7bded9d9da1f b004912a8510
585 8 28 2ed7a51aed47 c72365ee036f 7bded9d9da1f
586
382
587 (This `hg log` output if wrong, since no merge actually happened).
383 (This `hg log` output if wrong, since no merge actually happened).
588
384
589 $ hg log -Gfr 'desc("mBDm-0")' d
385 $ hg log -Gfr 'desc("mBDm-0")' d
590 o 17 mBDm-0 simple merge - one way
386 o 17 mBDm-0 simple merge - one way
591 |\
387 |\
592 o : 8 d-2 re-add d
388 o : 8 d-2 re-add d
593 :/
389 :/
594 o 2 i-2: c -move-> d
390 o 2 i-2: c -move-> d
595 |
391 |
596 o 1 i-1: a -move-> c
392 o 1 i-1: a -move-> c
597 |
393 |
598 o 0 i-0 initial commit: a b h
394 o 0 i-0 initial commit: a b h
599
395
600
396
601 This `hg log` output is correct
397 This `hg log` output is correct
602
398
603 $ hg log -Gfr 'desc("mDBm-0")' d
399 $ hg log -Gfr 'desc("mDBm-0")' d
604 o 8 d-2 re-add d
400 o 8 d-2 re-add d
605 |
401 |
606 ~
402 ~
607
403
608 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
404 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
609 M b
405 M b
610 A d
406 A d
611 a
407 a
612 R a
408 R a
613 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
409 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
614 M b
410 M b
615 A d
411 A d
616 R a
412 R a
617
413
414
618 Comparing with a merge with colliding rename
415 Comparing with a merge with colliding rename
619 --------------------------------------------
416 --------------------------------------------
620
417
621 - the "e-" branch renaming b to f (through 'g')
418 - the "e-" branch renaming b to f (through 'g')
622 - the "a-" branch renaming d to f (through e)
419 - the "a-" branch renaming d to f (through e)
623
420
421 $ hg up 'desc("a-2")'
422 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
423 $ hg merge 'desc("e-2")'
424 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
425 (branch merge, don't forget to commit)
426 $ hg ci -m 'mAEm-0 simple merge - one way'
427 $ hg up 'desc("e-2")'
428 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
429 $ hg merge 'desc("a-2")'
430 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
431 (branch merge, don't forget to commit)
432 $ hg ci -m 'mEAm-0 simple merge - the other way'
433 created new head
434 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
435 @ 20 mEAm-0 simple merge - the other way
436 |\
437 +---o 19 mAEm-0 simple merge - one way
438 | |/
439 | o 10 e-2 g -move-> f
440 | |
441 | o 9 e-1 b -move-> g
442 | |
443 o | 4 a-2: e -move-> f
444 | |
445 o | 3 a-1: d -move-> e
446 |/
447 o 2 i-2: c -move-> d
448 |
449 o 1 i-1: a -move-> c
450 |
451 o 0 i-0 initial commit: a b h
452
624 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
453 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
625 eb806e34ef6be4c264effd5933d31004ad15a793 644 f
454 eb806e34ef6be4c264effd5933d31004ad15a793 644 f
626 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
455 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
627 eb806e34ef6be4c264effd5933d31004ad15a793 644 f
456 eb806e34ef6be4c264effd5933d31004ad15a793 644 f
628 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
457 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
629 0dd616bc7ab1a111921d95d76f69cda5c2ac539c 644 f
458 0dd616bc7ab1a111921d95d76f69cda5c2ac539c 644 f
630 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
459 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
631 6da5a2eecb9c833f830b67a4972366d49a9a142c 644 f
460 6da5a2eecb9c833f830b67a4972366d49a9a142c 644 f
632 $ hg debugindex f
461 $ hg debugindex f
633 rev linkrev nodeid p1 p2
462 rev linkrev nodeid p1 p2
634 0 4 0dd616bc7ab1 000000000000 000000000000
463 0 4 0dd616bc7ab1 000000000000 000000000000
635 1 10 6da5a2eecb9c 000000000000 000000000000
464 1 10 6da5a2eecb9c 000000000000 000000000000
636 2 19 eb806e34ef6b 0dd616bc7ab1 6da5a2eecb9c
465 2 19 eb806e34ef6b 0dd616bc7ab1 6da5a2eecb9c
637 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
466 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
638 M f
467 M f
639 R b
468 R b
640 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
469 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
641 M f
470 M f
642 R b
471 R b
643 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
472 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
644 M f
473 M f
645 R d
474 R d
646 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
475 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
647 M f
476 M f
648 R d
477 R d
649 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
478 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
650 A f
479 A f
651 d
480 d
652 R d
481 R d
653 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
482 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
654 A f
483 A f
655 b
484 b
656 R b
485 R b
657 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
486 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
658 A f
487 A f
659 d
488 d
660 R b
489 R b
661 R d
490 R d
662 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
491 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
663 A f
492 A f
664 d
493 d
665 R b
494 R b
666 R d
495 R d
667 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
496 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
668 A f
497 A f
669 a
498 a
670 R a
499 R a
671 R b
500 R b
672 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
501 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
673 A f
502 A f
674 a
503 a
675 R a
504 R a
676 R b
505 R b
677
506
507
508 Note:
509 | In this case, one of the merge wrongly record a merge while there is none.
510 | This lead to bad copy tracing information to be dug up.
511
512
678 Merge:
513 Merge:
679 - one with change to an unrelated file (b)
514 - one with change to an unrelated file (b)
680 - one overwriting a file (d) with a rename (from h to i to d)
515 - one overwriting a file (d) with a rename (from h to i to d)
681
516
517 $ hg up 'desc("i-2")'
518 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
519 $ hg mv h i
520 $ hg commit -m "f-1: rename h -> i"
521 created new head
522 $ hg mv --force i d
523 $ hg commit -m "f-2: rename i -> d"
524 $ hg debugindex d
525 rev linkrev nodeid p1 p2
526 0 2 01c2f5eabdc4 000000000000 000000000000
527 1 8 b004912a8510 000000000000 000000000000
528 2 17 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
529 3 22 c72365ee036f 000000000000 000000000000
530 $ hg up 'desc("b-1")'
531 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
532 $ hg merge 'desc("f-2")'
533 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
534 (branch merge, don't forget to commit)
535 $ hg ci -m 'mBFm-0 simple merge - one way'
536 $ hg up 'desc("f-2")'
537 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
538 $ hg merge 'desc("b-1")'
539 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
540 (branch merge, don't forget to commit)
541 $ hg ci -m 'mFBm-0 simple merge - the other way'
542 created new head
543 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
544 @ 24 mFBm-0 simple merge - the other way
545 |\
546 +---o 23 mBFm-0 simple merge - one way
547 | |/
548 | o 22 f-2: rename i -> d
549 | |
550 | o 21 f-1: rename h -> i
551 | |
552 o | 5 b-1: b update
553 |/
554 o 2 i-2: c -move-> d
555 |
556 o 1 i-1: a -move-> c
557 |
558 o 0 i-0 initial commit: a b h
559
682 The overwriting should take over. However, the behavior is currently buggy
560 The overwriting should take over. However, the behavior is currently buggy
683
561
684 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
562 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
685 M b
563 M b
686 A d
564 A d
687 a (true !)
565 a (true !)
688 h (false !)
566 h (false !)
689 R a
567 R a
690 R h
568 R h
691 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
569 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
692 M b
570 M b
693 A d
571 A d
694 h
572 h
695 R a
573 R a
696 R h
574 R h
697 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
575 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
698 M d
576 M d
699 R h
577 R h
700 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
578 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
701 M b
579 M b
702 M d
580 M d
703 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
581 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
704 M b
582 M b
705 M d
583 M d
706 R i
584 R i
707 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
585 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
708 M d
586 M d
709 R h
587 R h
710 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
588 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
711 M b
589 M b
712 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
590 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
713 M b
591 M b
714 M d
592 M d
715 R i
593 R i
716
594
717 The following graphlog is wrong, the "a -> c -> d" chain was overwritten and should not appear.
595 The following graphlog is wrong, the "a -> c -> d" chain was overwritten and should not appear.
718
596
719 $ hg log -Gfr 'desc("mBFm-0")' d
597 $ hg log -Gfr 'desc("mBFm-0")' d
720 o 23 mBFm-0 simple merge - one way
598 o 23 mBFm-0 simple merge - one way
721 |\
599 |\
722 o : 22 f-2: rename i -> d
600 o : 22 f-2: rename i -> d
723 | :
601 | :
724 o : 21 f-1: rename h -> i
602 o : 21 f-1: rename h -> i
725 :/
603 :/
726 o 2 i-2: c -move-> d
604 o 2 i-2: c -move-> d
727 |
605 |
728 o 1 i-1: a -move-> c
606 o 1 i-1: a -move-> c
729 |
607 |
730 o 0 i-0 initial commit: a b h
608 o 0 i-0 initial commit: a b h
731
609
732
610
733 The following output is correct.
611 The following output is correct.
734
612
735 $ hg log -Gfr 'desc("mFBm-0")' d
613 $ hg log -Gfr 'desc("mFBm-0")' d
736 o 22 f-2: rename i -> d
614 o 22 f-2: rename i -> d
737 |
615 |
738 o 21 f-1: rename h -> i
616 o 21 f-1: rename h -> i
739 :
617 :
740 o 0 i-0 initial commit: a b h
618 o 0 i-0 initial commit: a b h
741
619
742
620
621
743 Merge:
622 Merge:
744 - one with change to a file
623 - one with change to a file
745 - one deleting and recreating the file
624 - one deleting and recreating the file
746
625
747 Unlike in the 'BD/DB' cases, an actuall merge happened here. So we should
626 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
748 consider history and rename on both branch of the merge.
627 consider history and rename on both branch of the merge.
749
628
629 $ hg up 'desc("i-2")'
630 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
631 $ echo "some update" >> d
632 $ hg commit -m "g-1: update d"
633 created new head
634 $ hg up 'desc("d-2")'
635 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
636 $ hg merge 'desc("g-1")' --tool :union
637 merging d
638 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
639 (branch merge, don't forget to commit)
640 $ hg ci -m 'mDGm-0 simple merge - one way'
641 $ hg up 'desc("g-1")'
642 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
643 $ hg merge 'desc("d-2")' --tool :union
644 merging d
645 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
646 (branch merge, don't forget to commit)
647 $ hg ci -m 'mGDm-0 simple merge - the other way'
648 created new head
649 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
650 @ 27 mGDm-0 simple merge - the other way
651 |\
652 +---o 26 mDGm-0 simple merge - one way
653 | |/
654 | o 25 g-1: update d
655 | |
656 o | 8 d-2 re-add d
657 | |
658 o | 7 d-1 delete d
659 |/
660 o 2 i-2: c -move-> d
661 |
662 o 1 i-1: a -move-> c
663 |
664 o 0 i-0 initial commit: a b h
665
750 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
666 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
751 A d
667 A d
752 a
668 a
753 R a
669 R a
754 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
670 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
755 A d
671 A d
756 a
672 a
757 R a
673 R a
758 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
674 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
759 M d
675 M d
760 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
676 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
761 M d
677 M d
762 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
678 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
763 M d
679 M d
764 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
680 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
765 M d
681 M d
766
682
767 $ hg log -Gfr 'desc("mDGm-0")' d
683 $ hg log -Gfr 'desc("mDGm-0")' d
768 o 26 mDGm-0 simple merge - one way
684 o 26 mDGm-0 simple merge - one way
769 |\
685 |\
770 | o 25 g-1: update d
686 | o 25 g-1: update d
771 | |
687 | |
772 o | 8 d-2 re-add d
688 o | 8 d-2 re-add d
773 |/
689 |/
774 o 2 i-2: c -move-> d
690 o 2 i-2: c -move-> d
775 |
691 |
776 o 1 i-1: a -move-> c
692 o 1 i-1: a -move-> c
777 |
693 |
778 o 0 i-0 initial commit: a b h
694 o 0 i-0 initial commit: a b h
779
695
780
696
781
697
782 $ hg log -Gfr 'desc("mDGm-0")' d
698 $ hg log -Gfr 'desc("mDGm-0")' d
783 o 26 mDGm-0 simple merge - one way
699 o 26 mDGm-0 simple merge - one way
784 |\
700 |\
785 | o 25 g-1: update d
701 | o 25 g-1: update d
786 | |
702 | |
787 o | 8 d-2 re-add d
703 o | 8 d-2 re-add d
788 |/
704 |/
789 o 2 i-2: c -move-> d
705 o 2 i-2: c -move-> d
790 |
706 |
791 o 1 i-1: a -move-> c
707 o 1 i-1: a -move-> c
792 |
708 |
793 o 0 i-0 initial commit: a b h
709 o 0 i-0 initial commit: a b h
794
710
795
711
796
712
797 Merge:
713 Merge:
798 - one with change to a file (d)
714 - one with change to a file (d)
799 - one overwriting that file with a rename (from h to i, to d)
715 - one overwriting that file with a rename (from h to i, to d)
800
716
801 This case is similar to BF/FB, but an actual merge happens, so both side of the
717 This case is similar to BF/FB, but an actual merge happens, so both side of the
802 history are relevant.
718 history are relevant.
803
719
804 Note:
720 Note:
805 | In this case, the merge get conflicting information since on one side we have
721 | In this case, the merge get conflicting information since on one side we have
806 | "a -> c -> d". and one the other one we have "h -> i -> d".
722 | "a -> c -> d". and one the other one we have "h -> i -> d".
807 |
723 |
808 | The current code arbitrarily pick one side
724 | The current code arbitrarily pick one side
809
725
726 $ hg up 'desc("f-2")'
727 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
728 $ hg merge 'desc("g-1")' --tool :union
729 merging d
730 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
731 (branch merge, don't forget to commit)
732 $ hg ci -m 'mFGm-0 simple merge - one way'
733 created new head
734 $ hg up 'desc("g-1")'
735 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
736 $ hg merge 'desc("f-2")' --tool :union
737 merging d
738 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
739 (branch merge, don't forget to commit)
740 $ hg ci -m 'mGFm-0 simple merge - the other way'
741 created new head
742 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
743 @ 29 mGFm-0 simple merge - the other way
744 |\
745 +---o 28 mFGm-0 simple merge - one way
746 | |/
747 | o 25 g-1: update d
748 | |
749 o | 22 f-2: rename i -> d
750 | |
751 o | 21 f-1: rename h -> i
752 |/
753 o 2 i-2: c -move-> d
754 |
755 o 1 i-1: a -move-> c
756 |
757 o 0 i-0 initial commit: a b h
758
810 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
759 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
811 A d
760 A d
812 a
761 a
813 R a
762 R a
814 R h
763 R h
815 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
764 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
816 A d
765 A d
817 a
766 a
818 R a
767 R a
819 R h
768 R h
820 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
769 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
821 M d
770 M d
822 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
771 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
823 M d
772 M d
824 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
773 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
825 M d
774 M d
826 R i
775 R i
827 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
776 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
828 M d
777 M d
829 R i
778 R i
830 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
779 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
831 M d
780 M d
832 R h
781 R h
833 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
782 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
834 M d
783 M d
835 R h
784 R h
836
785
837 $ hg log -Gfr 'desc("mFGm-0")' d
786 $ hg log -Gfr 'desc("mFGm-0")' d
838 o 28 mFGm-0 simple merge - one way
787 o 28 mFGm-0 simple merge - one way
839 |\
788 |\
840 | o 25 g-1: update d
789 | o 25 g-1: update d
841 | |
790 | |
842 o | 22 f-2: rename i -> d
791 o | 22 f-2: rename i -> d
843 | |
792 | |
844 o | 21 f-1: rename h -> i
793 o | 21 f-1: rename h -> i
845 |/
794 |/
846 o 2 i-2: c -move-> d
795 o 2 i-2: c -move-> d
847 |
796 |
848 o 1 i-1: a -move-> c
797 o 1 i-1: a -move-> c
849 |
798 |
850 o 0 i-0 initial commit: a b h
799 o 0 i-0 initial commit: a b h
851
800
852
801
853
854 $ hg log -Gfr 'desc("mGFm-0")' d
802 $ hg log -Gfr 'desc("mGFm-0")' d
855 @ 29 mGFm-0 simple merge - the other way
803 @ 29 mGFm-0 simple merge - the other way
856 |\
804 |\
857 | o 25 g-1: update d
805 | o 25 g-1: update d
858 | |
806 | |
859 o | 22 f-2: rename i -> d
807 o | 22 f-2: rename i -> d
860 | |
808 | |
861 o | 21 f-1: rename h -> i
809 o | 21 f-1: rename h -> i
862 |/
810 |/
863 o 2 i-2: c -move-> d
811 o 2 i-2: c -move-> d
864 |
812 |
865 o 1 i-1: a -move-> c
813 o 1 i-1: a -move-> c
866 |
814 |
867 o 0 i-0 initial commit: a b h
815 o 0 i-0 initial commit: a b h
868
816
General Comments 0
You need to be logged in to leave comments. Login now