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