##// END OF EJS Templates
test-copies: add a `p` branch similar to the `a` but on the new files...
marmoute -
r47304:067307d6 default
parent child Browse files
Show More
@@ -1,2829 +1,2866 b''
1 #testcases filelog compatibility changeset sidedata upgraded
1 #testcases filelog compatibility changeset sidedata upgraded
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 >> ./no-linkrev
17 $ cat << EOF >> ./no-linkrev
18 > #!$PYTHON
18 > #!$PYTHON
19 > # filter out linkrev part of the debugindex command
19 > # filter out linkrev part of the debugindex command
20 > import sys
20 > import sys
21 > for line in sys.stdin:
21 > for line in sys.stdin:
22 > if " linkrev " in line:
22 > if " linkrev " in line:
23 > print(line.rstrip())
23 > print(line.rstrip())
24 > else:
24 > else:
25 > l = "%s *%s" % (line[:6], line[14:].rstrip())
25 > l = "%s *%s" % (line[:6], line[14:].rstrip())
26 > print(l)
26 > print(l)
27 > EOF
27 > EOF
28 $ chmod +x no-linkrev
28 $ chmod +x no-linkrev
29
29
30 $ cat << EOF >> $HGRCPATH
30 $ cat << EOF >> $HGRCPATH
31 > [diff]
31 > [diff]
32 > git=yes
32 > git=yes
33 > [command-templates]
33 > [command-templates]
34 > log={desc}\n
34 > log={desc}\n
35 > EOF
35 > EOF
36
36
37 #if compatibility
37 #if compatibility
38 $ cat >> $HGRCPATH << EOF
38 $ cat >> $HGRCPATH << EOF
39 > [experimental]
39 > [experimental]
40 > copies.read-from = compatibility
40 > copies.read-from = compatibility
41 > EOF
41 > EOF
42 #endif
42 #endif
43
43
44 #if changeset
44 #if changeset
45 $ cat >> $HGRCPATH << EOF
45 $ cat >> $HGRCPATH << EOF
46 > [experimental]
46 > [experimental]
47 > copies.read-from = changeset-only
47 > copies.read-from = changeset-only
48 > copies.write-to = changeset-only
48 > copies.write-to = changeset-only
49 > EOF
49 > EOF
50 #endif
50 #endif
51
51
52 #if sidedata
52 #if sidedata
53 $ cat >> $HGRCPATH << EOF
53 $ cat >> $HGRCPATH << EOF
54 > [format]
54 > [format]
55 > exp-use-side-data = yes
55 > exp-use-side-data = yes
56 > exp-use-copies-side-data-changeset = yes
56 > exp-use-copies-side-data-changeset = yes
57 > EOF
57 > EOF
58 #endif
58 #endif
59
59
60
60
61 $ cat > same-content.txt << EOF
61 $ cat > same-content.txt << EOF
62 > Here is some content that will be the same accros multiple file.
62 > Here is some content that will be the same accros multiple file.
63 >
63 >
64 > This is done on purpose so that we end up in some merge situation, were the
64 > This is done on purpose so that we end up in some merge situation, were the
65 > resulting content is the same as in the parent(s), but a new filenodes still
65 > resulting content is the same as in the parent(s), but a new filenodes still
66 > need to be created to record some file history information (especially
66 > need to be created to record some file history information (especially
67 > about copies).
67 > about copies).
68 > EOF
68 > EOF
69
69
70 $ hg init repo-chain
70 $ hg init repo-chain
71 $ cd repo-chain
71 $ cd repo-chain
72
72
73 Add some linear rename initialy
73 Add some linear rename initialy
74
74
75 $ cp ../same-content.txt a
75 $ cp ../same-content.txt a
76 $ cp ../same-content.txt b
76 $ cp ../same-content.txt b
77 $ cp ../same-content.txt h
77 $ cp ../same-content.txt h
78 $ echo "original content for P" > p
78 $ echo "original content for P" > p
79 $ echo "original content for Q" > q
79 $ echo "original content for Q" > q
80 $ echo "original content for R" > r
80 $ echo "original content for R" > r
81 $ hg ci -Am 'i-0 initial commit: a b h'
81 $ hg ci -Am 'i-0 initial commit: a b h'
82 adding a
82 adding a
83 adding b
83 adding b
84 adding h
84 adding h
85 adding p
85 adding p
86 adding q
86 adding q
87 adding r
87 adding r
88 $ hg mv a c
88 $ hg mv a c
89 $ hg mv p s
89 $ hg mv p s
90 $ hg ci -Am 'i-1: a -move-> c, p -move-> s'
90 $ hg ci -Am 'i-1: a -move-> c, p -move-> s'
91 $ hg mv c d
91 $ hg mv c d
92 $ hg mv s t
92 $ hg mv s t
93 $ hg ci -Am 'i-2: c -move-> d, s -move-> t'
93 $ hg ci -Am 'i-2: c -move-> d, s -move-> t'
94 $ hg log -G
94 $ hg log -G
95 @ i-2: c -move-> d, s -move-> t
95 @ i-2: c -move-> d, s -move-> t
96 |
96 |
97 o i-1: a -move-> c, p -move-> s
97 o i-1: a -move-> c, p -move-> s
98 |
98 |
99 o i-0 initial commit: a b h
99 o i-0 initial commit: a b h
100
100
101
101
102 And having another branch with renames on the other side
102 And having another branch with renames on the other side
103
103
104 $ hg mv d e
104 $ hg mv d e
105 $ hg ci -Am 'a-1: d -move-> e'
105 $ hg ci -Am 'a-1: d -move-> e'
106 $ hg mv e f
106 $ hg mv e f
107 $ hg ci -Am 'a-2: e -move-> f'
107 $ hg ci -Am 'a-2: e -move-> f'
108 $ hg log -G --rev '::.'
108 $ hg log -G --rev '::.'
109 @ a-2: e -move-> f
109 @ a-2: e -move-> f
110 |
110 |
111 o a-1: d -move-> e
111 o a-1: d -move-> e
112 |
112 |
113 o i-2: c -move-> d, s -move-> t
113 o i-2: c -move-> d, s -move-> t
114 |
114 |
115 o i-1: a -move-> c, p -move-> s
115 o i-1: a -move-> c, p -move-> s
116 |
116 |
117 o i-0 initial commit: a b h
117 o i-0 initial commit: a b h
118
118
119
119
120 Have a branching with nothing on one side
120 Have a branching with nothing on one side
121
121
122 $ hg up 'desc("i-2")'
122 $ hg up 'desc("i-2")'
123 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
123 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
124 $ echo foo > b
124 $ echo foo > b
125 $ hg ci -m 'b-1: b update'
125 $ hg ci -m 'b-1: b update'
126 created new head
126 created new head
127 $ hg log -G --rev '::.'
127 $ hg log -G --rev '::.'
128 @ b-1: b update
128 @ b-1: b update
129 |
129 |
130 o i-2: c -move-> d, s -move-> t
130 o i-2: c -move-> d, s -move-> t
131 |
131 |
132 o i-1: a -move-> c, p -move-> s
132 o i-1: a -move-> c, p -move-> s
133 |
133 |
134 o i-0 initial commit: a b h
134 o i-0 initial commit: a b h
135
135
136
136
137 Create a branch that delete a file previous renamed
137 Create a branch that delete a file previous renamed
138
138
139 $ hg up 'desc("i-2")'
139 $ hg up 'desc("i-2")'
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 $ hg rm d
141 $ hg rm d
142 $ hg ci -m 'c-1 delete d'
142 $ hg ci -m 'c-1 delete d'
143 created new head
143 created new head
144 $ hg log -G --rev '::.'
144 $ hg log -G --rev '::.'
145 @ c-1 delete d
145 @ c-1 delete d
146 |
146 |
147 o i-2: c -move-> d, s -move-> t
147 o i-2: c -move-> d, s -move-> t
148 |
148 |
149 o i-1: a -move-> c, p -move-> s
149 o i-1: a -move-> c, p -move-> s
150 |
150 |
151 o i-0 initial commit: a b h
151 o i-0 initial commit: a b h
152
152
153
153
154 Create a branch that delete a file previous renamed and recreate it
154 Create a branch that delete a file previous renamed and recreate it
155
155
156 $ hg up 'desc("i-2")'
156 $ hg up 'desc("i-2")'
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 $ hg rm d
158 $ hg rm d
159 $ hg ci -m 'd-1 delete d'
159 $ hg ci -m 'd-1 delete d'
160 created new head
160 created new head
161 $ echo bar > d
161 $ echo bar > d
162 $ hg add d
162 $ hg add d
163 $ hg ci -m 'd-2 re-add d'
163 $ hg ci -m 'd-2 re-add d'
164 $ hg log -G --rev '::.'
164 $ hg log -G --rev '::.'
165 @ d-2 re-add d
165 @ d-2 re-add d
166 |
166 |
167 o d-1 delete d
167 o d-1 delete d
168 |
168 |
169 o i-2: c -move-> d, s -move-> t
169 o i-2: c -move-> d, s -move-> t
170 |
170 |
171 o i-1: a -move-> c, p -move-> s
171 o i-1: a -move-> c, p -move-> s
172 |
172 |
173 o i-0 initial commit: a b h
173 o i-0 initial commit: a b h
174
174
175
175
176 Having another branch renaming a different file to the same filename as another
176 Having another branch renaming a different file to the same filename as another
177
177
178 $ hg up 'desc("i-2")'
178 $ hg up 'desc("i-2")'
179 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
180 $ hg mv b g
180 $ hg mv b g
181 $ hg ci -m 'e-1 b -move-> g'
181 $ hg ci -m 'e-1 b -move-> g'
182 created new head
182 created new head
183 $ hg mv g f
183 $ hg mv g f
184 $ hg ci -m 'e-2 g -move-> f'
184 $ hg ci -m 'e-2 g -move-> f'
185 $ hg log -G --rev '::.'
185 $ hg log -G --rev '::.'
186 @ e-2 g -move-> f
186 @ e-2 g -move-> f
187 |
187 |
188 o e-1 b -move-> g
188 o e-1 b -move-> g
189 |
189 |
190 o i-2: c -move-> d, s -move-> t
190 o i-2: c -move-> d, s -move-> t
191 |
191 |
192 o i-1: a -move-> c, p -move-> s
192 o i-1: a -move-> c, p -move-> s
193 |
193 |
194 o i-0 initial commit: a b h
194 o i-0 initial commit: a b h
195
195
196 $ hg up -q null
197
198 Having a branch similar to the 'a' one, but moving the 'p' file around.
199
200 $ hg up 'desc("i-2")'
201 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
202 $ hg mv t u
203 $ hg ci -Am 'p-1: t -move-> u'
204 created new head
205 $ hg mv u v
206 $ hg ci -Am 'p-2: u -move-> v'
207 $ hg log -G --rev '::.'
208 @ p-2: u -move-> v
209 |
210 o p-1: t -move-> u
211 |
212 o i-2: c -move-> d, s -move-> t
213 |
214 o i-1: a -move-> c, p -move-> s
215 |
216 o i-0 initial commit: a b h
217
218 $ hg up -q null
196
219
197 Setup all merge
220 Setup all merge
198 ===============
221 ===============
199
222
200 This is done beforehand to validate that the upgrade process creates valid copy
223 This is done beforehand to validate that the upgrade process creates valid copy
201 information.
224 information.
202
225
203 merging with unrelated change does not interfere with the renames
226 merging with unrelated change does not interfere with the renames
204 ---------------------------------------------------------------
227 ---------------------------------------------------------------
205
228
206 - rename on one side
229 - rename on one side
207 - unrelated change on the other side
230 - unrelated change on the other side
208
231
209 $ case_desc="simple merge - A side: multiple renames, B side: unrelated update"
232 $ case_desc="simple merge - A side: multiple renames, B side: unrelated update"
210
233
211 $ hg up 'desc("b-1")'
234 $ hg up 'desc("b-1")'
212 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
235 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
213 $ hg merge 'desc("a-2")'
236 $ hg merge 'desc("a-2")'
214 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
237 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
215 (branch merge, don't forget to commit)
238 (branch merge, don't forget to commit)
216 $ hg ci -m "mBAm-0 $case_desc - one way"
239 $ hg ci -m "mBAm-0 $case_desc - one way"
217 $ hg up 'desc("a-2")'
240 $ hg up 'desc("a-2")'
218 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
219 $ hg merge 'desc("b-1")'
242 $ hg merge 'desc("b-1")'
220 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
243 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
221 (branch merge, don't forget to commit)
244 (branch merge, don't forget to commit)
222 $ hg ci -m "mABm-0 $case_desc - the other way"
245 $ hg ci -m "mABm-0 $case_desc - the other way"
223 created new head
246 created new head
224 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
247 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
225 @ mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
248 @ mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
226 |\
249 |\
227 +---o mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
250 +---o mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
228 | |/
251 | |/
229 | o b-1: b update
252 | o b-1: b update
230 | |
253 | |
231 o | a-2: e -move-> f
254 o | a-2: e -move-> f
232 | |
255 | |
233 o | a-1: d -move-> e
256 o | a-1: d -move-> e
234 |/
257 |/
235 o i-2: c -move-> d, s -move-> t
258 o i-2: c -move-> d, s -move-> t
236 |
259 |
237 o i-1: a -move-> c, p -move-> s
260 o i-1: a -move-> c, p -move-> s
238 |
261 |
239 o i-0 initial commit: a b h
262 o i-0 initial commit: a b h
240
263
241
264
242
265
243 merging with the side having a delete
266 merging with the side having a delete
244 -------------------------------------
267 -------------------------------------
245
268
246 case summary:
269 case summary:
247 - one with change to an unrelated file
270 - one with change to an unrelated file
248 - one deleting the change
271 - one deleting the change
249 and recreate an unrelated file after the merge
272 and recreate an unrelated file after the merge
250
273
251 $ case_desc="simple merge - C side: delete a file with copies history , B side: unrelated update"
274 $ case_desc="simple merge - C side: delete a file with copies history , B side: unrelated update"
252
275
253 $ hg up 'desc("b-1")'
276 $ hg up 'desc("b-1")'
254 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
277 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
255 $ hg merge 'desc("c-1")'
278 $ hg merge 'desc("c-1")'
256 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
279 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
257 (branch merge, don't forget to commit)
280 (branch merge, don't forget to commit)
258 $ hg ci -m "mBCm-0 $case_desc - one way"
281 $ hg ci -m "mBCm-0 $case_desc - one way"
259 $ echo bar > d
282 $ echo bar > d
260 $ hg add d
283 $ hg add d
261 $ hg ci -m 'mBCm-1 re-add d'
284 $ hg ci -m 'mBCm-1 re-add d'
262 $ hg up 'desc("c-1")'
285 $ hg up 'desc("c-1")'
263 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
286 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
264 $ hg merge 'desc("b-1")'
287 $ hg merge 'desc("b-1")'
265 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 (branch merge, don't forget to commit)
289 (branch merge, don't forget to commit)
267 $ hg ci -m "mCBm-0 $case_desc - the other way"
290 $ hg ci -m "mCBm-0 $case_desc - the other way"
268 created new head
291 created new head
269 $ echo bar > d
292 $ echo bar > d
270 $ hg add d
293 $ hg add d
271 $ hg ci -m 'mCBm-1 re-add d'
294 $ hg ci -m 'mCBm-1 re-add d'
272 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
295 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
273 @ mCBm-1 re-add d
296 @ mCBm-1 re-add d
274 |
297 |
275 o mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
298 o mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
276 |\
299 |\
277 | | o mBCm-1 re-add d
300 | | o mBCm-1 re-add d
278 | | |
301 | | |
279 +---o mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
302 +---o mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
280 | |/
303 | |/
281 | o c-1 delete d
304 | o c-1 delete d
282 | |
305 | |
283 o | b-1: b update
306 o | b-1: b update
284 |/
307 |/
285 o i-2: c -move-> d, s -move-> t
308 o i-2: c -move-> d, s -move-> t
286 |
309 |
287 o i-1: a -move-> c, p -move-> s
310 o i-1: a -move-> c, p -move-> s
288 |
311 |
289 o i-0 initial commit: a b h
312 o i-0 initial commit: a b h
290
313
291
314
292 Comparing with a merge re-adding the file afterward
315 Comparing with a merge re-adding the file afterward
293 ---------------------------------------------------
316 ---------------------------------------------------
294
317
295 Merge:
318 Merge:
296 - one with change to an unrelated file
319 - one with change to an unrelated file
297 - one deleting and recreating the change
320 - one deleting and recreating the change
298
321
299 $ case_desc="simple merge - B side: unrelated update, D side: delete and recreate a file (with different content)"
322 $ case_desc="simple merge - B side: unrelated update, D side: delete and recreate a file (with different content)"
300
323
301 $ hg up 'desc("b-1")'
324 $ hg up 'desc("b-1")'
302 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
325 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
303 $ hg merge 'desc("d-2")'
326 $ hg merge 'desc("d-2")'
304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
327 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
305 (branch merge, don't forget to commit)
328 (branch merge, don't forget to commit)
306 $ hg ci -m "mBDm-0 $case_desc - one way"
329 $ hg ci -m "mBDm-0 $case_desc - one way"
307 $ hg up 'desc("d-2")'
330 $ hg up 'desc("d-2")'
308 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
331 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
309 $ hg merge 'desc("b-1")'
332 $ hg merge 'desc("b-1")'
310 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
333 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
311 (branch merge, don't forget to commit)
334 (branch merge, don't forget to commit)
312 $ hg ci -m "mDBm-0 $case_desc - the other way"
335 $ hg ci -m "mDBm-0 $case_desc - the other way"
313 created new head
336 created new head
314 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
337 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
315 @ mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
338 @ mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
316 |\
339 |\
317 +---o mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
340 +---o mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
318 | |/
341 | |/
319 | o d-2 re-add d
342 | o d-2 re-add d
320 | |
343 | |
321 | o d-1 delete d
344 | o d-1 delete d
322 | |
345 | |
323 o | b-1: b update
346 o | b-1: b update
324 |/
347 |/
325 o i-2: c -move-> d, s -move-> t
348 o i-2: c -move-> d, s -move-> t
326 |
349 |
327 o i-1: a -move-> c, p -move-> s
350 o i-1: a -move-> c, p -move-> s
328 |
351 |
329 o i-0 initial commit: a b h
352 o i-0 initial commit: a b h
330
353
331
354
332
355
333 Comparing with a merge with colliding rename
356 Comparing with a merge with colliding rename
334 --------------------------------------------
357 --------------------------------------------
335
358
336 Subcase: new copy information on both side
359 Subcase: new copy information on both side
337 ``````````````````````````````````````````
360 ``````````````````````````````````````````
338
361
339 - the "e-" branch renaming b to f (through 'g')
362 - the "e-" branch renaming b to f (through 'g')
340 - the "a-" branch renaming d to f (through e)
363 - the "a-" branch renaming d to f (through e)
341
364
342 $ case_desc="merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f)"
365 $ case_desc="merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f)"
343
366
344 $ hg up 'desc("a-2")'
367 $ hg up 'desc("a-2")'
345 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
368 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
346 $ hg merge 'desc("e-2")'
369 $ hg merge 'desc("e-2")'
347 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
370 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
348 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
371 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
349 (branch merge, don't forget to commit)
372 (branch merge, don't forget to commit)
350 $ hg ci -m "mAEm-0 $case_desc - one way"
373 $ hg ci -m "mAEm-0 $case_desc - one way"
351 $ hg up 'desc("e-2")'
374 $ hg up 'desc("e-2")'
352 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
375 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
353 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
376 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
354 $ hg merge 'desc("a-2")'
377 $ hg merge 'desc("a-2")'
355 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
378 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
356 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
379 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
357 (branch merge, don't forget to commit)
380 (branch merge, don't forget to commit)
358 $ hg ci -m "mEAm-0 $case_desc - the other way"
381 $ hg ci -m "mEAm-0 $case_desc - the other way"
359 created new head
382 created new head
360 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
383 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
361 @ mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
384 @ mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
362 |\
385 |\
363 +---o mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
386 +---o mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
364 | |/
387 | |/
365 | o e-2 g -move-> f
388 | o e-2 g -move-> f
366 | |
389 | |
367 | o e-1 b -move-> g
390 | o e-1 b -move-> g
368 | |
391 | |
369 o | a-2: e -move-> f
392 o | a-2: e -move-> f
370 | |
393 | |
371 o | a-1: d -move-> e
394 o | a-1: d -move-> e
372 |/
395 |/
373 o i-2: c -move-> d, s -move-> t
396 o i-2: c -move-> d, s -move-> t
374 |
397 |
375 o i-1: a -move-> c, p -move-> s
398 o i-1: a -move-> c, p -move-> s
376 |
399 |
377 o i-0 initial commit: a b h
400 o i-0 initial commit: a b h
378
401
379
402
380 Subcase: existing copy information overwritten on one branch
403 Subcase: existing copy information overwritten on one branch
381 ````````````````````````````````````````````````````````````
404 ````````````````````````````````````````````````````````````
382
405
383 Merge:
406 Merge:
384 - one with change to an unrelated file (b)
407 - one with change to an unrelated file (b)
385 - one overwriting a file (d) with a rename (from h to i to d)
408 - one overwriting a file (d) with a rename (from h to i to d)
386
409
387 $ case_desc="simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d)"
410 $ case_desc="simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d)"
388
411
389 $ hg up 'desc("i-2")'
412 $ hg up 'desc("i-2")'
390 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
413 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
391 $ hg mv h i
414 $ hg mv h i
392 $ hg commit -m "f-1: rename h -> i"
415 $ hg commit -m "f-1: rename h -> i"
393 created new head
416 created new head
394 $ hg mv --force i d
417 $ hg mv --force i d
395 $ hg commit -m "f-2: rename i -> d"
418 $ hg commit -m "f-2: rename i -> d"
396 $ hg debugindex d | ../no-linkrev
419 $ hg debugindex d | ../no-linkrev
397 rev linkrev nodeid p1 p2
420 rev linkrev nodeid p1 p2
398 0 * d8252ab2e760 000000000000 000000000000 (no-changeset !)
421 0 * d8252ab2e760 000000000000 000000000000 (no-changeset !)
399 0 * ae258f702dfe 000000000000 000000000000 (changeset !)
422 0 * ae258f702dfe 000000000000 000000000000 (changeset !)
400 1 * b004912a8510 000000000000 000000000000
423 1 * b004912a8510 000000000000 000000000000
401 2 * 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
424 2 * 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
402 $ hg up 'desc("b-1")'
425 $ hg up 'desc("b-1")'
403 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
426 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
404 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
427 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
405 $ hg merge 'desc("f-2")'
428 $ hg merge 'desc("f-2")'
406 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
429 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
407 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
430 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
408 (branch merge, don't forget to commit)
431 (branch merge, don't forget to commit)
409 $ hg ci -m "mBFm-0 $case_desc - one way"
432 $ hg ci -m "mBFm-0 $case_desc - one way"
410 $ hg up 'desc("f-2")'
433 $ hg up 'desc("f-2")'
411 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
434 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
412 $ hg merge 'desc("b-1")'
435 $ hg merge 'desc("b-1")'
413 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
436 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 (branch merge, don't forget to commit)
437 (branch merge, don't forget to commit)
415 $ hg ci -m "mFBm-0 $case_desc - the other way"
438 $ hg ci -m "mFBm-0 $case_desc - the other way"
416 created new head
439 created new head
417 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
440 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
418 @ mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
441 @ mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
419 |\
442 |\
420 +---o mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
443 +---o mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
421 | |/
444 | |/
422 | o f-2: rename i -> d
445 | o f-2: rename i -> d
423 | |
446 | |
424 | o f-1: rename h -> i
447 | o f-1: rename h -> i
425 | |
448 | |
426 o | b-1: b update
449 o | b-1: b update
427 |/
450 |/
428 o i-2: c -move-> d, s -move-> t
451 o i-2: c -move-> d, s -move-> t
429 |
452 |
430 o i-1: a -move-> c, p -move-> s
453 o i-1: a -move-> c, p -move-> s
431 |
454 |
432 o i-0 initial commit: a b h
455 o i-0 initial commit: a b h
433
456
434
457
435
458
436 Subcase: reset of the copy history on one side
459 Subcase: reset of the copy history on one side
437 ``````````````````````````````````````````````
460 ``````````````````````````````````````````````
438
461
439 Merge:
462 Merge:
440 - one with change to a file
463 - one with change to a file
441 - one deleting and recreating the file
464 - one deleting and recreating the file
442
465
443 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
466 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
444 consider history and rename on both branch of the merge.
467 consider history and rename on both branch of the merge.
445
468
446 $ case_desc="actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content"
469 $ case_desc="actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content"
447
470
448 $ hg up 'desc("i-2")'
471 $ hg up 'desc("i-2")'
449 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
472 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
450 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
473 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
451 $ echo "some update" >> d
474 $ echo "some update" >> d
452 $ hg commit -m "g-1: update d"
475 $ hg commit -m "g-1: update d"
453 created new head
476 created new head
454 $ hg up 'desc("d-2")'
477 $ hg up 'desc("d-2")'
455 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
478 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
456 $ hg merge 'desc("g-1")' --tool :union
479 $ hg merge 'desc("g-1")' --tool :union
457 merging d
480 merging d
458 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
481 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
459 (branch merge, don't forget to commit)
482 (branch merge, don't forget to commit)
460 $ hg ci -m "mDGm-0 $case_desc - one way"
483 $ hg ci -m "mDGm-0 $case_desc - one way"
461 $ hg up 'desc("g-1")'
484 $ hg up 'desc("g-1")'
462 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
485 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 $ hg merge 'desc("d-2")' --tool :union
486 $ hg merge 'desc("d-2")' --tool :union
464 merging d
487 merging d
465 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
466 (branch merge, don't forget to commit)
489 (branch merge, don't forget to commit)
467 $ hg ci -m "mGDm-0 $case_desc - the other way"
490 $ hg ci -m "mGDm-0 $case_desc - the other way"
468 created new head
491 created new head
469 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
492 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
470 @ mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
493 @ mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
471 |\
494 |\
472 +---o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
495 +---o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
473 | |/
496 | |/
474 | o g-1: update d
497 | o g-1: update d
475 | |
498 | |
476 o | d-2 re-add d
499 o | d-2 re-add d
477 | |
500 | |
478 o | d-1 delete d
501 o | d-1 delete d
479 |/
502 |/
480 o i-2: c -move-> d, s -move-> t
503 o i-2: c -move-> d, s -move-> t
481 |
504 |
482 o i-1: a -move-> c, p -move-> s
505 o i-1: a -move-> c, p -move-> s
483 |
506 |
484 o i-0 initial commit: a b h
507 o i-0 initial commit: a b h
485
508
486
509
487 Subcase: merging a change to a file with a "copy overwrite" to that file from another branch
510 Subcase: merging a change to a file with a "copy overwrite" to that file from another branch
488 ````````````````````````````````````````````````````````````````````````````````````````````
511 ````````````````````````````````````````````````````````````````````````````````````````````
489
512
490 Merge:
513 Merge:
491 - one with change to a file (d)
514 - one with change to a file (d)
492 - one overwriting that file with a rename (from h to i, to d)
515 - one overwriting that file with a rename (from h to i, to d)
493
516
494 This case is similar to BF/FB, but an actual merge happens, so both side of the
517 This case is similar to BF/FB, but an actual merge happens, so both side of the
495 history are relevant.
518 history are relevant.
496
519
497 Note:
520 Note:
498 | In this case, the merge get conflicting information since on one side we have
521 | In this case, the merge get conflicting information since on one side we have
499 | "a -> c -> d". and one the other one we have "h -> i -> d".
522 | "a -> c -> d". and one the other one we have "h -> i -> d".
500 |
523 |
501 | The current code arbitrarily pick one side
524 | The current code arbitrarily pick one side
502
525
503 $ case_desc="merge - G side: content change, F side: copy overwrite, no content change"
526 $ case_desc="merge - G side: content change, F side: copy overwrite, no content change"
504
527
505 $ hg up 'desc("f-2")'
528 $ hg up 'desc("f-2")'
506 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
529 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
507 $ hg merge 'desc("g-1")' --tool :union
530 $ hg merge 'desc("g-1")' --tool :union
508 merging d (no-changeset !)
531 merging d (no-changeset !)
509 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (no-changeset !)
532 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (no-changeset !)
510 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
533 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
511 (branch merge, don't forget to commit)
534 (branch merge, don't forget to commit)
512 $ hg ci -m "mFGm-0 $case_desc - one way"
535 $ hg ci -m "mFGm-0 $case_desc - one way"
513 created new head
536 created new head
514 $ hg up 'desc("g-1")'
537 $ hg up 'desc("g-1")'
515 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
538 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
516 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
539 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
517 $ hg merge 'desc("f-2")' --tool :union
540 $ hg merge 'desc("f-2")' --tool :union
518 merging d (no-changeset !)
541 merging d (no-changeset !)
519 0 files updated, 1 files merged, 1 files removed, 0 files unresolved (no-changeset !)
542 0 files updated, 1 files merged, 1 files removed, 0 files unresolved (no-changeset !)
520 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
543 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
521 (branch merge, don't forget to commit)
544 (branch merge, don't forget to commit)
522 $ hg ci -m "mGFm-0 $case_desc - the other way"
545 $ hg ci -m "mGFm-0 $case_desc - the other way"
523 created new head
546 created new head
524 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
547 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
525 @ mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
548 @ mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
526 |\
549 |\
527 +---o mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
550 +---o mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
528 | |/
551 | |/
529 | o g-1: update d
552 | o g-1: update d
530 | |
553 | |
531 o | f-2: rename i -> d
554 o | f-2: rename i -> d
532 | |
555 | |
533 o | f-1: rename h -> i
556 o | f-1: rename h -> i
534 |/
557 |/
535 o i-2: c -move-> d, s -move-> t
558 o i-2: c -move-> d, s -move-> t
536 |
559 |
537 o i-1: a -move-> c, p -move-> s
560 o i-1: a -move-> c, p -move-> s
538 |
561 |
539 o i-0 initial commit: a b h
562 o i-0 initial commit: a b h
540
563
541
564
542
565
543 Comparing with merging with a deletion (and keeping the file)
566 Comparing with merging with a deletion (and keeping the file)
544 -------------------------------------------------------------
567 -------------------------------------------------------------
545
568
546 Merge:
569 Merge:
547 - one removing a file (d)
570 - one removing a file (d)
548 - one updating that file
571 - one updating that file
549 - the merge keep the modified version of the file (canceling the delete)
572 - the merge keep the modified version of the file (canceling the delete)
550
573
551 In this case, the file keep on living after the merge. So we should not drop its
574 In this case, the file keep on living after the merge. So we should not drop its
552 copy tracing chain.
575 copy tracing chain.
553
576
554 $ case_desc="merge updated/deleted - revive the file (updated content)"
577 $ case_desc="merge updated/deleted - revive the file (updated content)"
555
578
556 $ hg up 'desc("c-1")'
579 $ hg up 'desc("c-1")'
557 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
580 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
558 $ hg merge 'desc("g-1")'
581 $ hg merge 'desc("g-1")'
559 file 'd' was deleted in local [working copy] but was modified in other [merge rev].
582 file 'd' was deleted in local [working copy] but was modified in other [merge rev].
560 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
583 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
561 What do you want to do? u
584 What do you want to do? u
562 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
585 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
563 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
586 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
564 [1]
587 [1]
565 $ hg resolve -t :other d
588 $ hg resolve -t :other d
566 (no more unresolved files)
589 (no more unresolved files)
567 $ hg ci -m "mCGm-0 $case_desc - one way"
590 $ hg ci -m "mCGm-0 $case_desc - one way"
568 created new head
591 created new head
569
592
570 $ hg up 'desc("g-1")'
593 $ hg up 'desc("g-1")'
571 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
594 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
572 $ hg merge 'desc("c-1")'
595 $ hg merge 'desc("c-1")'
573 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
596 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
574 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
597 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
575 What do you want to do? u
598 What do you want to do? u
576 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
599 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
577 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
600 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
578 [1]
601 [1]
579 $ hg resolve -t :local d
602 $ hg resolve -t :local d
580 (no more unresolved files)
603 (no more unresolved files)
581 $ hg ci -m "mGCm-0 $case_desc - the other way"
604 $ hg ci -m "mGCm-0 $case_desc - the other way"
582 created new head
605 created new head
583
606
584 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
607 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
585 @ mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
608 @ mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
586 |\
609 |\
587 +---o mCGm-0 merge updated/deleted - revive the file (updated content) - one way
610 +---o mCGm-0 merge updated/deleted - revive the file (updated content) - one way
588 | |/
611 | |/
589 | o g-1: update d
612 | o g-1: update d
590 | |
613 | |
591 o | c-1 delete d
614 o | c-1 delete d
592 |/
615 |/
593 o i-2: c -move-> d, s -move-> t
616 o i-2: c -move-> d, s -move-> t
594 |
617 |
595 o i-1: a -move-> c, p -move-> s
618 o i-1: a -move-> c, p -move-> s
596 |
619 |
597 o i-0 initial commit: a b h
620 o i-0 initial commit: a b h
598
621
599
622
600
623
601
624
602 Comparing with merge restoring an untouched deleted file
625 Comparing with merge restoring an untouched deleted file
603 --------------------------------------------------------
626 --------------------------------------------------------
604
627
605 Merge:
628 Merge:
606 - one removing a file (d)
629 - one removing a file (d)
607 - one leaving the file untouched
630 - one leaving the file untouched
608 - the merge actively restore the file to the same content.
631 - the merge actively restore the file to the same content.
609
632
610 In this case, the file keep on living after the merge. So we should not drop its
633 In this case, the file keep on living after the merge. So we should not drop its
611 copy tracing chain.
634 copy tracing chain.
612
635
613 $ case_desc="merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge)"
636 $ case_desc="merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge)"
614
637
615 $ hg up 'desc("c-1")'
638 $ hg up 'desc("c-1")'
616 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
639 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
617 $ hg merge 'desc("b-1")'
640 $ hg merge 'desc("b-1")'
618 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
641 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
619 (branch merge, don't forget to commit)
642 (branch merge, don't forget to commit)
620 $ hg revert --rev 'desc("b-1")' d
643 $ hg revert --rev 'desc("b-1")' d
621 $ hg ci -m "mCB-revert-m-0 $case_desc - one way"
644 $ hg ci -m "mCB-revert-m-0 $case_desc - one way"
622 created new head
645 created new head
623
646
624 $ hg up 'desc("b-1")'
647 $ hg up 'desc("b-1")'
625 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
648 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
626 $ hg merge 'desc("c-1")'
649 $ hg merge 'desc("c-1")'
627 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
650 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
628 (branch merge, don't forget to commit)
651 (branch merge, don't forget to commit)
629 $ hg revert --rev 'desc("b-1")' d
652 $ hg revert --rev 'desc("b-1")' d
630 $ hg ci -m "mBC-revert-m-0 $case_desc - the other way"
653 $ hg ci -m "mBC-revert-m-0 $case_desc - the other way"
631 created new head
654 created new head
632
655
633 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
656 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
634 @ mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
657 @ mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
635 |\
658 |\
636 +---o mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
659 +---o mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
637 | |/
660 | |/
638 | o c-1 delete d
661 | o c-1 delete d
639 | |
662 | |
640 o | b-1: b update
663 o | b-1: b update
641 |/
664 |/
642 o i-2: c -move-> d, s -move-> t
665 o i-2: c -move-> d, s -move-> t
643 |
666 |
644 o i-1: a -move-> c, p -move-> s
667 o i-1: a -move-> c, p -move-> s
645 |
668 |
646 o i-0 initial commit: a b h
669 o i-0 initial commit: a b h
647
670
648
671
649
672
650 $ hg up null --quiet
673 $ hg up null --quiet
651
674
652 Merging a branch where a rename was deleted with a branch where the same file was renamed
675 Merging a branch where a rename was deleted with a branch where the same file was renamed
653 ------------------------------------------------------------------------------------------
676 ------------------------------------------------------------------------------------------
654
677
655 Create a "conflicting" merge where `d` get removed on one branch before its
678 Create a "conflicting" merge where `d` get removed on one branch before its
656 rename information actually conflict with the other branch.
679 rename information actually conflict with the other branch.
657
680
658 (the copy information from the branch that was not deleted should win).
681 (the copy information from the branch that was not deleted should win).
659
682
660 $ case_desc="simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch)"
683 $ case_desc="simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch)"
661
684
662 $ hg up 'desc("i-0")'
685 $ hg up 'desc("i-0")'
663 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
686 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
664 $ hg mv b d
687 $ hg mv b d
665 $ hg ci -m "h-1: b -(move)-> d"
688 $ hg ci -m "h-1: b -(move)-> d"
666 created new head
689 created new head
667
690
668 $ hg up 'desc("c-1")'
691 $ hg up 'desc("c-1")'
669 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
692 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
670 $ hg merge 'desc("h-1")'
693 $ hg merge 'desc("h-1")'
671 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
694 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
672 (branch merge, don't forget to commit)
695 (branch merge, don't forget to commit)
673 $ hg ci -m "mCH-delete-before-conflict-m-0 $case_desc - one way"
696 $ hg ci -m "mCH-delete-before-conflict-m-0 $case_desc - one way"
674
697
675 $ hg up 'desc("h-1")'
698 $ hg up 'desc("h-1")'
676 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
699 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
677 $ hg merge 'desc("c-1")'
700 $ hg merge 'desc("c-1")'
678 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
701 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
679 (branch merge, don't forget to commit)
702 (branch merge, don't forget to commit)
680 $ hg ci -m "mHC-delete-before-conflict-m-0 $case_desc - the other way"
703 $ hg ci -m "mHC-delete-before-conflict-m-0 $case_desc - the other way"
681 created new head
704 created new head
682 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
705 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
683 @ mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
706 @ mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
684 |\
707 |\
685 +---o mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
708 +---o mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
686 | |/
709 | |/
687 | o h-1: b -(move)-> d
710 | o h-1: b -(move)-> d
688 | |
711 | |
689 o | c-1 delete d
712 o | c-1 delete d
690 | |
713 | |
691 o | i-2: c -move-> d, s -move-> t
714 o | i-2: c -move-> d, s -move-> t
692 | |
715 | |
693 o | i-1: a -move-> c, p -move-> s
716 o | i-1: a -move-> c, p -move-> s
694 |/
717 |/
695 o i-0 initial commit: a b h
718 o i-0 initial commit: a b h
696
719
697
720
698 Variant of previous with extra changes introduced by the merge
721 Variant of previous with extra changes introduced by the merge
699 --------------------------------------------------------------
722 --------------------------------------------------------------
700
723
701 Multiple cases above explicitely test cases where content are the same on both side during merge. In this section we will introduce variants for theses cases where new change are introduced to these file content during the merges.
724 Multiple cases above explicitely test cases where content are the same on both side during merge. In this section we will introduce variants for theses cases where new change are introduced to these file content during the merges.
702
725
703
726
704 Subcase: merge has same initial content on both side, but merge introduced a change
727 Subcase: merge has same initial content on both side, but merge introduced a change
705 ```````````````````````````````````````````````````````````````````````````````````
728 ```````````````````````````````````````````````````````````````````````````````````
706
729
707 Same as `mAEm` and `mEAm` but with extra change to the file before commiting
730 Same as `mAEm` and `mEAm` but with extra change to the file before commiting
708
731
709 - the "e-" branch renaming b to f (through 'g')
732 - the "e-" branch renaming b to f (through 'g')
710 - the "a-" branch renaming d to f (through e)
733 - the "a-" branch renaming d to f (through e)
711
734
712 $ case_desc="merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent)"
735 $ case_desc="merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent)"
713
736
714 $ hg up 'desc("a-2")'
737 $ hg up 'desc("a-2")'
715 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
738 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
716 $ hg merge 'desc("e-2")'
739 $ hg merge 'desc("e-2")'
717 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
740 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
718 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
741 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
719 (branch merge, don't forget to commit)
742 (branch merge, don't forget to commit)
720 $ echo "content change for mAE-change-m" > f
743 $ echo "content change for mAE-change-m" > f
721 $ hg ci -m "mAE-change-m-0 $case_desc - one way"
744 $ hg ci -m "mAE-change-m-0 $case_desc - one way"
722 created new head
745 created new head
723 $ hg up 'desc("e-2")'
746 $ hg up 'desc("e-2")'
724 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
747 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
725 $ hg merge 'desc("a-2")'
748 $ hg merge 'desc("a-2")'
726 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
749 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
727 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
750 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
728 (branch merge, don't forget to commit)
751 (branch merge, don't forget to commit)
729 $ echo "content change for mEA-change-m" > f
752 $ echo "content change for mEA-change-m" > f
730 $ hg ci -m "mEA-change-m-0 $case_desc - the other way"
753 $ hg ci -m "mEA-change-m-0 $case_desc - the other way"
731 created new head
754 created new head
732 $ hg log -G --rev '::(desc("mAE-change-m")+desc("mEA-change-m"))'
755 $ hg log -G --rev '::(desc("mAE-change-m")+desc("mEA-change-m"))'
733 @ mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
756 @ mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
734 |\
757 |\
735 +---o mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
758 +---o mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
736 | |/
759 | |/
737 | o e-2 g -move-> f
760 | o e-2 g -move-> f
738 | |
761 | |
739 | o e-1 b -move-> g
762 | o e-1 b -move-> g
740 | |
763 | |
741 o | a-2: e -move-> f
764 o | a-2: e -move-> f
742 | |
765 | |
743 o | a-1: d -move-> e
766 o | a-1: d -move-> e
744 |/
767 |/
745 o i-2: c -move-> d, s -move-> t
768 o i-2: c -move-> d, s -move-> t
746 |
769 |
747 o i-1: a -move-> c, p -move-> s
770 o i-1: a -move-> c, p -move-> s
748 |
771 |
749 o i-0 initial commit: a b h
772 o i-0 initial commit: a b h
750
773
751
774
752 Decision from previous merge are properly chained with later merge
775 Decision from previous merge are properly chained with later merge
753 ------------------------------------------------------------------
776 ------------------------------------------------------------------
754
777
755 Subcase: chaining conflicting rename resolution
778 Subcase: chaining conflicting rename resolution
756 ```````````````````````````````````````````````
779 ```````````````````````````````````````````````
757
780
758 The "mAEm" and "mEAm" case create a rename tracking conflict on file 'f'. We
781 The "mAEm" and "mEAm" case create a rename tracking conflict on file 'f'. We
759 add more change on the respective branch and merge again. These second merge
782 add more change on the respective branch and merge again. These second merge
760 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
783 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
761 about that file should stay unchanged.
784 about that file should stay unchanged.
762
785
763 $ case_desc="chained merges (conflict -> simple) - same content everywhere"
786 $ case_desc="chained merges (conflict -> simple) - same content everywhere"
764
787
765 (extra unrelated changes)
788 (extra unrelated changes)
766
789
767 $ hg up 'desc("a-2")'
790 $ hg up 'desc("a-2")'
768 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
791 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
769 $ echo j > unrelated-j
792 $ echo j > unrelated-j
770 $ hg add unrelated-j
793 $ hg add unrelated-j
771 $ hg ci -m 'j-1: unrelated changes (based on the "a" series of changes)'
794 $ hg ci -m 'j-1: unrelated changes (based on the "a" series of changes)'
772 created new head
795 created new head
773
796
774 $ hg up 'desc("e-2")'
797 $ hg up 'desc("e-2")'
775 2 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
798 2 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
776 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
799 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
777 $ echo k > unrelated-k
800 $ echo k > unrelated-k
778 $ hg add unrelated-k
801 $ hg add unrelated-k
779 $ hg ci -m 'k-1: unrelated changes (based on "e" changes)'
802 $ hg ci -m 'k-1: unrelated changes (based on "e" changes)'
780 created new head
803 created new head
781
804
782 (merge variant 1)
805 (merge variant 1)
783
806
784 $ hg up 'desc("mAEm")'
807 $ hg up 'desc("mAEm")'
785 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
808 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
786 0 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
809 0 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
787 $ hg merge 'desc("k-1")'
810 $ hg merge 'desc("k-1")'
788 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
811 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
789 (branch merge, don't forget to commit)
812 (branch merge, don't forget to commit)
790 $ hg ci -m "mAE,Km: $case_desc"
813 $ hg ci -m "mAE,Km: $case_desc"
791
814
792 (merge variant 2)
815 (merge variant 2)
793
816
794 $ hg up 'desc("k-1")'
817 $ hg up 'desc("k-1")'
795 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
818 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
796 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
819 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
797
820
798 $ hg merge 'desc("mAEm")'
821 $ hg merge 'desc("mAEm")'
799 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
822 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
800 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
823 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
801 (branch merge, don't forget to commit)
824 (branch merge, don't forget to commit)
802 $ hg ci -m "mK,AEm: $case_desc"
825 $ hg ci -m "mK,AEm: $case_desc"
803 created new head
826 created new head
804
827
805 (merge variant 3)
828 (merge variant 3)
806
829
807 $ hg up 'desc("mEAm")'
830 $ hg up 'desc("mEAm")'
808 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
831 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
809 $ hg merge 'desc("j-1")'
832 $ hg merge 'desc("j-1")'
810 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
833 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
811 (branch merge, don't forget to commit)
834 (branch merge, don't forget to commit)
812 $ hg ci -m "mEA,Jm: $case_desc"
835 $ hg ci -m "mEA,Jm: $case_desc"
813
836
814 (merge variant 4)
837 (merge variant 4)
815
838
816 $ hg up 'desc("j-1")'
839 $ hg up 'desc("j-1")'
817 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
840 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
818 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
841 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
819 $ hg merge 'desc("mEAm")'
842 $ hg merge 'desc("mEAm")'
820 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
843 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
821 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
844 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
822 (branch merge, don't forget to commit)
845 (branch merge, don't forget to commit)
823 $ hg ci -m "mJ,EAm: $case_desc"
846 $ hg ci -m "mJ,EAm: $case_desc"
824 created new head
847 created new head
825
848
826
849
827 $ hg log -G --rev '::(desc("mAE,Km") + desc("mK,AEm") + desc("mEA,Jm") + desc("mJ,EAm"))'
850 $ hg log -G --rev '::(desc("mAE,Km") + desc("mK,AEm") + desc("mEA,Jm") + desc("mJ,EAm"))'
828 @ mJ,EAm: chained merges (conflict -> simple) - same content everywhere
851 @ mJ,EAm: chained merges (conflict -> simple) - same content everywhere
829 |\
852 |\
830 +---o mEA,Jm: chained merges (conflict -> simple) - same content everywhere
853 +---o mEA,Jm: chained merges (conflict -> simple) - same content everywhere
831 | |/
854 | |/
832 | | o mK,AEm: chained merges (conflict -> simple) - same content everywhere
855 | | o mK,AEm: chained merges (conflict -> simple) - same content everywhere
833 | | |\
856 | | |\
834 | | +---o mAE,Km: chained merges (conflict -> simple) - same content everywhere
857 | | +---o mAE,Km: chained merges (conflict -> simple) - same content everywhere
835 | | | |/
858 | | | |/
836 | | | o k-1: unrelated changes (based on "e" changes)
859 | | | o k-1: unrelated changes (based on "e" changes)
837 | | | |
860 | | | |
838 | o | | j-1: unrelated changes (based on the "a" series of changes)
861 | o | | j-1: unrelated changes (based on the "a" series of changes)
839 | | | |
862 | | | |
840 o-----+ mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
863 o-----+ mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
841 |/ / /
864 |/ / /
842 | o / mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
865 | o / mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
843 |/|/
866 |/|/
844 | o e-2 g -move-> f
867 | o e-2 g -move-> f
845 | |
868 | |
846 | o e-1 b -move-> g
869 | o e-1 b -move-> g
847 | |
870 | |
848 o | a-2: e -move-> f
871 o | a-2: e -move-> f
849 | |
872 | |
850 o | a-1: d -move-> e
873 o | a-1: d -move-> e
851 |/
874 |/
852 o i-2: c -move-> d, s -move-> t
875 o i-2: c -move-> d, s -move-> t
853 |
876 |
854 o i-1: a -move-> c, p -move-> s
877 o i-1: a -move-> c, p -move-> s
855 |
878 |
856 o i-0 initial commit: a b h
879 o i-0 initial commit: a b h
857
880
858
881
859 Subcase: chaining salvage information during a merge
882 Subcase: chaining salvage information during a merge
860 ````````````````````````````````````````````````````
883 ````````````````````````````````````````````````````
861
884
862 We add more change on the branch were the file was deleted. merging again
885 We add more change on the branch were the file was deleted. merging again
863 should preserve the fact eh file was salvaged.
886 should preserve the fact eh file was salvaged.
864
887
865 $ case_desc="chained merges (salvaged -> simple) - same content (when the file exists)"
888 $ case_desc="chained merges (salvaged -> simple) - same content (when the file exists)"
866
889
867 (creating the change)
890 (creating the change)
868
891
869 $ hg up 'desc("c-1")'
892 $ hg up 'desc("c-1")'
870 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
893 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
871 $ echo l > unrelated-l
894 $ echo l > unrelated-l
872 $ hg add unrelated-l
895 $ hg add unrelated-l
873 $ hg ci -m 'l-1: unrelated changes (based on "c" changes)'
896 $ hg ci -m 'l-1: unrelated changes (based on "c" changes)'
874 created new head
897 created new head
875
898
876 (Merge variant 1)
899 (Merge variant 1)
877
900
878 $ hg up 'desc("mBC-revert-m")'
901 $ hg up 'desc("mBC-revert-m")'
879 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
902 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
880 $ hg merge 'desc("l-1")'
903 $ hg merge 'desc("l-1")'
881 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
904 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
882 (branch merge, don't forget to commit)
905 (branch merge, don't forget to commit)
883 $ hg ci -m "mBC+revert,Lm: $case_desc"
906 $ hg ci -m "mBC+revert,Lm: $case_desc"
884
907
885 (Merge variant 2)
908 (Merge variant 2)
886
909
887 $ hg up 'desc("mCB-revert-m")'
910 $ hg up 'desc("mCB-revert-m")'
888 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
911 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
889 $ hg merge 'desc("l-1")'
912 $ hg merge 'desc("l-1")'
890 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
913 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
891 (branch merge, don't forget to commit)
914 (branch merge, don't forget to commit)
892 $ hg ci -m "mCB+revert,Lm: $case_desc"
915 $ hg ci -m "mCB+revert,Lm: $case_desc"
893
916
894 (Merge variant 3)
917 (Merge variant 3)
895
918
896 $ hg up 'desc("l-1")'
919 $ hg up 'desc("l-1")'
897 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
920 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
898
921
899 $ hg merge 'desc("mBC-revert-m")'
922 $ hg merge 'desc("mBC-revert-m")'
900 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
923 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
901 (branch merge, don't forget to commit)
924 (branch merge, don't forget to commit)
902 $ hg ci -m "mL,BC+revertm: $case_desc"
925 $ hg ci -m "mL,BC+revertm: $case_desc"
903 created new head
926 created new head
904
927
905 (Merge variant 4)
928 (Merge variant 4)
906
929
907 $ hg up 'desc("l-1")'
930 $ hg up 'desc("l-1")'
908 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
931 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
909
932
910 $ hg merge 'desc("mCB-revert-m")'
933 $ hg merge 'desc("mCB-revert-m")'
911 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
934 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
912 (branch merge, don't forget to commit)
935 (branch merge, don't forget to commit)
913 $ hg ci -m "mL,CB+revertm: $case_desc"
936 $ hg ci -m "mL,CB+revertm: $case_desc"
914 created new head
937 created new head
915
938
916 $ hg log -G --rev '::(desc("mBC+revert,Lm") + desc("mCB+revert,Lm") + desc("mL,BC+revertm") + desc("mL,CB+revertm"))'
939 $ hg log -G --rev '::(desc("mBC+revert,Lm") + desc("mCB+revert,Lm") + desc("mL,BC+revertm") + desc("mL,CB+revertm"))'
917 @ mL,CB+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
940 @ mL,CB+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
918 |\
941 |\
919 | | o mL,BC+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
942 | | o mL,BC+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
920 | |/|
943 | |/|
921 +-+---o mCB+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
944 +-+---o mCB+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
922 | | |
945 | | |
923 | +---o mBC+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
946 | +---o mBC+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
924 | | |/
947 | | |/
925 | o | l-1: unrelated changes (based on "c" changes)
948 | o | l-1: unrelated changes (based on "c" changes)
926 | | |
949 | | |
927 | | o mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
950 | | o mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
928 | |/|
951 | |/|
929 o---+ mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
952 o---+ mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
930 |/ /
953 |/ /
931 o | c-1 delete d
954 o | c-1 delete d
932 | |
955 | |
933 | o b-1: b update
956 | o b-1: b update
934 |/
957 |/
935 o i-2: c -move-> d, s -move-> t
958 o i-2: c -move-> d, s -move-> t
936 |
959 |
937 o i-1: a -move-> c, p -move-> s
960 o i-1: a -move-> c, p -move-> s
938 |
961 |
939 o i-0 initial commit: a b h
962 o i-0 initial commit: a b h
940
963
941
964
942
965
943 Subcase: chaining "merged" information during a merge
966 Subcase: chaining "merged" information during a merge
944 ``````````````````````````````````````````````````````
967 ``````````````````````````````````````````````````````
945
968
946 When a non-rename change are merged with a copy overwrite, the merge pick the copy source from (p1) as the reference. We should preserve this information in subsequent merges.
969 When a non-rename change are merged with a copy overwrite, the merge pick the copy source from (p1) as the reference. We should preserve this information in subsequent merges.
947
970
948 $ case_desc="chained merges (copy-overwrite -> simple) - same content"
971 $ case_desc="chained merges (copy-overwrite -> simple) - same content"
949
972
950 (extra unrelated changes)
973 (extra unrelated changes)
951
974
952 $ hg up 'desc("f-2")'
975 $ hg up 'desc("f-2")'
953 2 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
976 2 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
954 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
977 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
955 $ echo n > unrelated-n
978 $ echo n > unrelated-n
956 $ hg add unrelated-n
979 $ hg add unrelated-n
957 $ hg ci -m 'n-1: unrelated changes (based on the "f" series of changes)'
980 $ hg ci -m 'n-1: unrelated changes (based on the "f" series of changes)'
958 created new head
981 created new head
959
982
960 $ hg up 'desc("g-1")'
983 $ hg up 'desc("g-1")'
961 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
984 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
962 $ echo o > unrelated-o
985 $ echo o > unrelated-o
963 $ hg add unrelated-o
986 $ hg add unrelated-o
964 $ hg ci -m 'o-1: unrelated changes (based on "g" changes)'
987 $ hg ci -m 'o-1: unrelated changes (based on "g" changes)'
965 created new head
988 created new head
966
989
967 (merge variant 1)
990 (merge variant 1)
968
991
969 $ hg up 'desc("mFGm")'
992 $ hg up 'desc("mFGm")'
970 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
993 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
971 0 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
994 0 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
972 $ hg merge 'desc("o-1")'
995 $ hg merge 'desc("o-1")'
973 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
996 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
974 (branch merge, don't forget to commit)
997 (branch merge, don't forget to commit)
975 $ hg ci -m "mFG,Om: $case_desc"
998 $ hg ci -m "mFG,Om: $case_desc"
976
999
977 (merge variant 2)
1000 (merge variant 2)
978
1001
979 $ hg up 'desc("o-1")'
1002 $ hg up 'desc("o-1")'
980 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
1003 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
981 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
1004 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
982 $ hg merge 'desc("FGm")'
1005 $ hg merge 'desc("FGm")'
983 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
1006 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
984 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
1007 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
985 (branch merge, don't forget to commit)
1008 (branch merge, don't forget to commit)
986 $ hg ci -m "mO,FGm: $case_desc"
1009 $ hg ci -m "mO,FGm: $case_desc"
987 created new head
1010 created new head
988
1011
989 (merge variant 3)
1012 (merge variant 3)
990
1013
991 $ hg up 'desc("mGFm")'
1014 $ hg up 'desc("mGFm")'
992 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1015 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
993 $ hg merge 'desc("n-1")'
1016 $ hg merge 'desc("n-1")'
994 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1017 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
995 (branch merge, don't forget to commit)
1018 (branch merge, don't forget to commit)
996 $ hg ci -m "mGF,Nm: $case_desc"
1019 $ hg ci -m "mGF,Nm: $case_desc"
997
1020
998 (merge variant 4)
1021 (merge variant 4)
999
1022
1000 $ hg up 'desc("n-1")'
1023 $ hg up 'desc("n-1")'
1001 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1024 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1002 $ hg merge 'desc("mGFm")'
1025 $ hg merge 'desc("mGFm")'
1003 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1026 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1004 (branch merge, don't forget to commit)
1027 (branch merge, don't forget to commit)
1005 $ hg ci -m "mN,GFm: $case_desc"
1028 $ hg ci -m "mN,GFm: $case_desc"
1006 created new head
1029 created new head
1007
1030
1008 $ hg log -G --rev '::(desc("mFG,Om") + desc("mO,FGm") + desc("mGF,Nm") + desc("mN,GFm"))'
1031 $ hg log -G --rev '::(desc("mFG,Om") + desc("mO,FGm") + desc("mGF,Nm") + desc("mN,GFm"))'
1009 @ mN,GFm: chained merges (copy-overwrite -> simple) - same content
1032 @ mN,GFm: chained merges (copy-overwrite -> simple) - same content
1010 |\
1033 |\
1011 +---o mGF,Nm: chained merges (copy-overwrite -> simple) - same content
1034 +---o mGF,Nm: chained merges (copy-overwrite -> simple) - same content
1012 | |/
1035 | |/
1013 | | o mO,FGm: chained merges (copy-overwrite -> simple) - same content
1036 | | o mO,FGm: chained merges (copy-overwrite -> simple) - same content
1014 | | |\
1037 | | |\
1015 | | +---o mFG,Om: chained merges (copy-overwrite -> simple) - same content
1038 | | +---o mFG,Om: chained merges (copy-overwrite -> simple) - same content
1016 | | | |/
1039 | | | |/
1017 | | | o o-1: unrelated changes (based on "g" changes)
1040 | | | o o-1: unrelated changes (based on "g" changes)
1018 | | | |
1041 | | | |
1019 | o | | n-1: unrelated changes (based on the "f" series of changes)
1042 | o | | n-1: unrelated changes (based on the "f" series of changes)
1020 | | | |
1043 | | | |
1021 o-----+ mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
1044 o-----+ mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
1022 |/ / /
1045 |/ / /
1023 | o / mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
1046 | o / mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
1024 |/|/
1047 |/|/
1025 | o g-1: update d
1048 | o g-1: update d
1026 | |
1049 | |
1027 o | f-2: rename i -> d
1050 o | f-2: rename i -> d
1028 | |
1051 | |
1029 o | f-1: rename h -> i
1052 o | f-1: rename h -> i
1030 |/
1053 |/
1031 o i-2: c -move-> d, s -move-> t
1054 o i-2: c -move-> d, s -move-> t
1032 |
1055 |
1033 o i-1: a -move-> c, p -move-> s
1056 o i-1: a -move-> c, p -move-> s
1034 |
1057 |
1035 o i-0 initial commit: a b h
1058 o i-0 initial commit: a b h
1036
1059
1037
1060
1038 Subcase: chaining conflicting rename resolution, with extra change during the merge
1061 Subcase: chaining conflicting rename resolution, with extra change during the merge
1039 ```````````````````````````````````````````````````````````````````````````````````
1062 ```````````````````````````````````````````````````````````````````````````````````
1040
1063
1041 The "mEA-change-m-0" and "mAE-change-m-0" case create a rename tracking conflict on file 'f'. We
1064 The "mEA-change-m-0" and "mAE-change-m-0" case create a rename tracking conflict on file 'f'. We
1042 add more change on the respective branch and merge again. These second merge
1065 add more change on the respective branch and merge again. These second merge
1043 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
1066 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
1044 about that file should stay unchanged.
1067 about that file should stay unchanged.
1045
1068
1046 $ case_desc="chained merges (conflict+change -> simple) - same content on both branch in the initial merge"
1069 $ case_desc="chained merges (conflict+change -> simple) - same content on both branch in the initial merge"
1047
1070
1048
1071
1049 (merge variant 1)
1072 (merge variant 1)
1050
1073
1051 $ hg up 'desc("mAE-change-m")'
1074 $ hg up 'desc("mAE-change-m")'
1052 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
1075 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
1053 $ hg merge 'desc("k-1")'
1076 $ hg merge 'desc("k-1")'
1054 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1077 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1055 (branch merge, don't forget to commit)
1078 (branch merge, don't forget to commit)
1056 $ hg ci -m "mAE-change,Km: $case_desc"
1079 $ hg ci -m "mAE-change,Km: $case_desc"
1057
1080
1058 (merge variant 2)
1081 (merge variant 2)
1059
1082
1060 $ hg up 'desc("k-1")'
1083 $ hg up 'desc("k-1")'
1061 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1084 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1062
1085
1063 $ hg merge 'desc("mAE-change-m")'
1086 $ hg merge 'desc("mAE-change-m")'
1064 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1087 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1065 (branch merge, don't forget to commit)
1088 (branch merge, don't forget to commit)
1066 $ hg ci -m "mK,AE-change-m: $case_desc"
1089 $ hg ci -m "mK,AE-change-m: $case_desc"
1067 created new head
1090 created new head
1068
1091
1069 (merge variant 3)
1092 (merge variant 3)
1070
1093
1071 $ hg up 'desc("mEA-change-m")'
1094 $ hg up 'desc("mEA-change-m")'
1072 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1095 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1073 $ hg merge 'desc("j-1")'
1096 $ hg merge 'desc("j-1")'
1074 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1097 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1075 (branch merge, don't forget to commit)
1098 (branch merge, don't forget to commit)
1076 $ hg ci -m "mEA-change,Jm: $case_desc"
1099 $ hg ci -m "mEA-change,Jm: $case_desc"
1077
1100
1078 (merge variant 4)
1101 (merge variant 4)
1079
1102
1080 $ hg up 'desc("j-1")'
1103 $ hg up 'desc("j-1")'
1081 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1104 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1082 $ hg merge 'desc("mEA-change-m")'
1105 $ hg merge 'desc("mEA-change-m")'
1083 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1106 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1084 (branch merge, don't forget to commit)
1107 (branch merge, don't forget to commit)
1085 $ hg ci -m "mJ,EA-change-m: $case_desc"
1108 $ hg ci -m "mJ,EA-change-m: $case_desc"
1086 created new head
1109 created new head
1087
1110
1088
1111
1089 $ hg log -G --rev '::(desc("mAE-change,Km") + desc("mK,AE-change-m") + desc("mEA-change,Jm") + desc("mJ,EA-change-m"))'
1112 $ hg log -G --rev '::(desc("mAE-change,Km") + desc("mK,AE-change-m") + desc("mEA-change,Jm") + desc("mJ,EA-change-m"))'
1090 @ mJ,EA-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1113 @ mJ,EA-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1091 |\
1114 |\
1092 +---o mEA-change,Jm: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1115 +---o mEA-change,Jm: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1093 | |/
1116 | |/
1094 | | o mK,AE-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1117 | | o mK,AE-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1095 | | |\
1118 | | |\
1096 | | +---o mAE-change,Km: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1119 | | +---o mAE-change,Km: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1097 | | | |/
1120 | | | |/
1098 | | | o k-1: unrelated changes (based on "e" changes)
1121 | | | o k-1: unrelated changes (based on "e" changes)
1099 | | | |
1122 | | | |
1100 | o | | j-1: unrelated changes (based on the "a" series of changes)
1123 | o | | j-1: unrelated changes (based on the "a" series of changes)
1101 | | | |
1124 | | | |
1102 o-----+ mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
1125 o-----+ mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
1103 |/ / /
1126 |/ / /
1104 | o / mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
1127 | o / mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
1105 |/|/
1128 |/|/
1106 | o e-2 g -move-> f
1129 | o e-2 g -move-> f
1107 | |
1130 | |
1108 | o e-1 b -move-> g
1131 | o e-1 b -move-> g
1109 | |
1132 | |
1110 o | a-2: e -move-> f
1133 o | a-2: e -move-> f
1111 | |
1134 | |
1112 o | a-1: d -move-> e
1135 o | a-1: d -move-> e
1113 |/
1136 |/
1114 o i-2: c -move-> d, s -move-> t
1137 o i-2: c -move-> d, s -move-> t
1115 |
1138 |
1116 o i-1: a -move-> c, p -move-> s
1139 o i-1: a -move-> c, p -move-> s
1117 |
1140 |
1118 o i-0 initial commit: a b h
1141 o i-0 initial commit: a b h
1119
1142
1120
1143
1121 Summary of all created cases
1144 Summary of all created cases
1122 ----------------------------
1145 ----------------------------
1123
1146
1124 $ hg up --quiet null
1147 $ hg up --quiet null
1125
1148
1126 (This exists to help keeping a compact list of the various cases we have built)
1149 (This exists to help keeping a compact list of the various cases we have built)
1127
1150
1128 $ hg log -T '{desc|firstline}\n'| sort
1151 $ hg log -T '{desc|firstline}\n'| sort
1129 a-1: d -move-> e
1152 a-1: d -move-> e
1130 a-2: e -move-> f
1153 a-2: e -move-> f
1131 b-1: b update
1154 b-1: b update
1132 c-1 delete d
1155 c-1 delete d
1133 d-1 delete d
1156 d-1 delete d
1134 d-2 re-add d
1157 d-2 re-add d
1135 e-1 b -move-> g
1158 e-1 b -move-> g
1136 e-2 g -move-> f
1159 e-2 g -move-> f
1137 f-1: rename h -> i
1160 f-1: rename h -> i
1138 f-2: rename i -> d
1161 f-2: rename i -> d
1139 g-1: update d
1162 g-1: update d
1140 h-1: b -(move)-> d
1163 h-1: b -(move)-> d
1141 i-0 initial commit: a b h
1164 i-0 initial commit: a b h
1142 i-1: a -move-> c, p -move-> s
1165 i-1: a -move-> c, p -move-> s
1143 i-2: c -move-> d, s -move-> t
1166 i-2: c -move-> d, s -move-> t
1144 j-1: unrelated changes (based on the "a" series of changes)
1167 j-1: unrelated changes (based on the "a" series of changes)
1145 k-1: unrelated changes (based on "e" changes)
1168 k-1: unrelated changes (based on "e" changes)
1146 l-1: unrelated changes (based on "c" changes)
1169 l-1: unrelated changes (based on "c" changes)
1147 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
1170 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
1148 mAE,Km: chained merges (conflict -> simple) - same content everywhere
1171 mAE,Km: chained merges (conflict -> simple) - same content everywhere
1149 mAE-change,Km: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1172 mAE-change,Km: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1150 mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
1173 mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
1151 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
1174 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
1152 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
1175 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
1153 mBC+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
1176 mBC+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
1154 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
1177 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
1155 mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
1178 mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
1156 mBCm-1 re-add d
1179 mBCm-1 re-add d
1157 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
1180 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
1158 mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
1181 mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
1159 mCB+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
1182 mCB+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
1160 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
1183 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
1161 mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
1184 mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
1162 mCBm-1 re-add d
1185 mCBm-1 re-add d
1163 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
1186 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
1164 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
1187 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
1165 mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
1188 mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
1166 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1189 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1167 mEA,Jm: chained merges (conflict -> simple) - same content everywhere
1190 mEA,Jm: chained merges (conflict -> simple) - same content everywhere
1168 mEA-change,Jm: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1191 mEA-change,Jm: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1169 mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
1192 mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
1170 mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
1193 mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
1171 mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
1194 mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
1172 mFG,Om: chained merges (copy-overwrite -> simple) - same content
1195 mFG,Om: chained merges (copy-overwrite -> simple) - same content
1173 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
1196 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
1174 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
1197 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
1175 mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
1198 mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
1176 mGF,Nm: chained merges (copy-overwrite -> simple) - same content
1199 mGF,Nm: chained merges (copy-overwrite -> simple) - same content
1177 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
1200 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
1178 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
1201 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
1179 mJ,EA-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1202 mJ,EA-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1180 mJ,EAm: chained merges (conflict -> simple) - same content everywhere
1203 mJ,EAm: chained merges (conflict -> simple) - same content everywhere
1181 mK,AE-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1204 mK,AE-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1182 mK,AEm: chained merges (conflict -> simple) - same content everywhere
1205 mK,AEm: chained merges (conflict -> simple) - same content everywhere
1183 mL,BC+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
1206 mL,BC+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
1184 mL,CB+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
1207 mL,CB+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
1185 mN,GFm: chained merges (copy-overwrite -> simple) - same content
1208 mN,GFm: chained merges (copy-overwrite -> simple) - same content
1186 mO,FGm: chained merges (copy-overwrite -> simple) - same content
1209 mO,FGm: chained merges (copy-overwrite -> simple) - same content
1187 n-1: unrelated changes (based on the "f" series of changes)
1210 n-1: unrelated changes (based on the "f" series of changes)
1188 o-1: unrelated changes (based on "g" changes)
1211 o-1: unrelated changes (based on "g" changes)
1212 p-1: t -move-> u
1213 p-2: u -move-> v
1189
1214
1190
1215
1191 Test that sidedata computations during upgrades are correct
1216 Test that sidedata computations during upgrades are correct
1192 ===========================================================
1217 ===========================================================
1193
1218
1194 We upgrade a repository that is not using sidedata (the filelog case) and
1219 We upgrade a repository that is not using sidedata (the filelog case) and
1195 check that the same side data have been generated as if they were computed at
1220 check that the same side data have been generated as if they were computed at
1196 commit time.
1221 commit time.
1197
1222
1198
1223
1199 #if upgraded
1224 #if upgraded
1200 $ cat >> $HGRCPATH << EOF
1225 $ cat >> $HGRCPATH << EOF
1201 > [format]
1226 > [format]
1202 > exp-use-side-data = yes
1227 > exp-use-side-data = yes
1203 > exp-use-copies-side-data-changeset = yes
1228 > exp-use-copies-side-data-changeset = yes
1204 > EOF
1229 > EOF
1205 $ hg debugformat -v
1230 $ hg debugformat -v
1206 format-variant repo config default
1231 format-variant repo config default
1207 fncache: yes yes yes
1232 fncache: yes yes yes
1208 dotencode: yes yes yes
1233 dotencode: yes yes yes
1209 generaldelta: yes yes yes
1234 generaldelta: yes yes yes
1210 share-safe: no no no
1235 share-safe: no no no
1211 sparserevlog: yes yes yes
1236 sparserevlog: yes yes yes
1212 sidedata: no yes no
1237 sidedata: no yes no
1213 persistent-nodemap: no no no
1238 persistent-nodemap: no no no
1214 copies-sdc: no yes no
1239 copies-sdc: no yes no
1215 plain-cl-delta: yes yes yes
1240 plain-cl-delta: yes yes yes
1216 compression: * (glob)
1241 compression: * (glob)
1217 compression-level: default default default
1242 compression-level: default default default
1218 $ hg debugupgraderepo --run --quiet
1243 $ hg debugupgraderepo --run --quiet
1219 upgrade will perform the following actions:
1244 upgrade will perform the following actions:
1220
1245
1221 requirements
1246 requirements
1222 preserved: * (glob)
1247 preserved: * (glob)
1223 added: exp-copies-sidedata-changeset, exp-sidedata-flag
1248 added: exp-copies-sidedata-changeset, exp-sidedata-flag
1224
1249
1225 processed revlogs:
1250 processed revlogs:
1226 - all-filelogs
1251 - all-filelogs
1227 - changelog
1252 - changelog
1228 - manifest
1253 - manifest
1229
1254
1230 #endif
1255 #endif
1231
1256
1232
1257
1233 #if no-compatibility no-filelog no-changeset
1258 #if no-compatibility no-filelog no-changeset
1234
1259
1235 $ hg debugchangedfiles --compute 0
1260 $ hg debugchangedfiles --compute 0
1236 added : a, ;
1261 added : a, ;
1237 added : b, ;
1262 added : b, ;
1238 added : h, ;
1263 added : h, ;
1239 added : p, ;
1264 added : p, ;
1240 added : q, ;
1265 added : q, ;
1241 added : r, ;
1266 added : r, ;
1242
1267
1243 $ for rev in `hg log --rev 'all()' -T '{rev}\n'`; do
1268 $ for rev in `hg log --rev 'all()' -T '{rev}\n'`; do
1244 > case_id=`hg log -r $rev -T '{word(0, desc, ":")}\n'`
1269 > case_id=`hg log -r $rev -T '{word(0, desc, ":")}\n'`
1245 > echo "##### revision \"$case_id\" #####"
1270 > echo "##### revision \"$case_id\" #####"
1246 > hg debugsidedata -c -v -- $rev
1271 > hg debugsidedata -c -v -- $rev
1247 > hg debugchangedfiles $rev
1272 > hg debugchangedfiles $rev
1248 > done
1273 > done
1249 ##### revision "i-0 initial commit" #####
1274 ##### revision "i-0 initial commit" #####
1250 1 sidedata entries
1275 1 sidedata entries
1251 entry-0014 size 64
1276 entry-0014 size 64
1252 '\x00\x00\x00\x06\x04\x00\x00\x00\x01\x00\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x00\x04\x00\x00\x00\x06\x00\x00\x00\x00abhpqr'
1277 '\x00\x00\x00\x06\x04\x00\x00\x00\x01\x00\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x00\x04\x00\x00\x00\x06\x00\x00\x00\x00abhpqr'
1253 added : a, ;
1278 added : a, ;
1254 added : b, ;
1279 added : b, ;
1255 added : h, ;
1280 added : h, ;
1256 added : p, ;
1281 added : p, ;
1257 added : q, ;
1282 added : q, ;
1258 added : r, ;
1283 added : r, ;
1259 ##### revision "i-1" #####
1284 ##### revision "i-1" #####
1260 1 sidedata entries
1285 1 sidedata entries
1261 entry-0014 size 44
1286 entry-0014 size 44
1262 '\x00\x00\x00\x04\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00\x0c\x00\x00\x00\x03\x00\x00\x00\x00\x06\x00\x00\x00\x04\x00\x00\x00\x02acps'
1287 '\x00\x00\x00\x04\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00\x0c\x00\x00\x00\x03\x00\x00\x00\x00\x06\x00\x00\x00\x04\x00\x00\x00\x02acps'
1263 removed : a, ;
1288 removed : a, ;
1264 added p1: c, a;
1289 added p1: c, a;
1265 removed : p, ;
1290 removed : p, ;
1266 added p1: s, p;
1291 added p1: s, p;
1267 ##### revision "i-2" #####
1292 ##### revision "i-2" #####
1268 1 sidedata entries
1293 1 sidedata entries
1269 entry-0014 size 44
1294 entry-0014 size 44
1270 '\x00\x00\x00\x04\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00\x0c\x00\x00\x00\x03\x00\x00\x00\x00\x06\x00\x00\x00\x04\x00\x00\x00\x02cdst'
1295 '\x00\x00\x00\x04\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00\x0c\x00\x00\x00\x03\x00\x00\x00\x00\x06\x00\x00\x00\x04\x00\x00\x00\x02cdst'
1271 removed : c, ;
1296 removed : c, ;
1272 added p1: d, c;
1297 added p1: d, c;
1273 removed : s, ;
1298 removed : s, ;
1274 added p1: t, s;
1299 added p1: t, s;
1275 ##### revision "a-1" #####
1300 ##### revision "a-1" #####
1276 1 sidedata entries
1301 1 sidedata entries
1277 entry-0014 size 24
1302 entry-0014 size 24
1278 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00de'
1303 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00de'
1279 removed : d, ;
1304 removed : d, ;
1280 added p1: e, d;
1305 added p1: e, d;
1281 ##### revision "a-2" #####
1306 ##### revision "a-2" #####
1282 1 sidedata entries
1307 1 sidedata entries
1283 entry-0014 size 24
1308 entry-0014 size 24
1284 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ef'
1309 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ef'
1285 removed : e, ;
1310 removed : e, ;
1286 added p1: f, e;
1311 added p1: f, e;
1287 ##### revision "b-1" #####
1312 ##### revision "b-1" #####
1288 1 sidedata entries
1313 1 sidedata entries
1289 entry-0014 size 14
1314 entry-0014 size 14
1290 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00b'
1315 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00b'
1291 touched : b, ;
1316 touched : b, ;
1292 ##### revision "c-1 delete d" #####
1317 ##### revision "c-1 delete d" #####
1293 1 sidedata entries
1318 1 sidedata entries
1294 entry-0014 size 14
1319 entry-0014 size 14
1295 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
1320 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
1296 removed : d, ;
1321 removed : d, ;
1297 ##### revision "d-1 delete d" #####
1322 ##### revision "d-1 delete d" #####
1298 1 sidedata entries
1323 1 sidedata entries
1299 entry-0014 size 14
1324 entry-0014 size 14
1300 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
1325 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
1301 removed : d, ;
1326 removed : d, ;
1302 ##### revision "d-2 re-add d" #####
1327 ##### revision "d-2 re-add d" #####
1303 1 sidedata entries
1328 1 sidedata entries
1304 entry-0014 size 14
1329 entry-0014 size 14
1305 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
1330 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
1306 added : d, ;
1331 added : d, ;
1307 ##### revision "e-1 b -move-> g" #####
1332 ##### revision "e-1 b -move-> g" #####
1308 1 sidedata entries
1333 1 sidedata entries
1309 entry-0014 size 24
1334 entry-0014 size 24
1310 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bg'
1335 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bg'
1311 removed : b, ;
1336 removed : b, ;
1312 added p1: g, b;
1337 added p1: g, b;
1313 ##### revision "e-2 g -move-> f" #####
1338 ##### revision "e-2 g -move-> f" #####
1314 1 sidedata entries
1339 1 sidedata entries
1315 entry-0014 size 24
1340 entry-0014 size 24
1316 '\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00fg'
1341 '\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00fg'
1317 added p1: f, g;
1342 added p1: f, g;
1318 removed : g, ;
1343 removed : g, ;
1344 ##### revision "p-1" #####
1345 1 sidedata entries
1346 entry-0014 size 24
1347 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00tu'
1348 removed : t, ;
1349 added p1: u, t;
1350 ##### revision "p-2" #####
1351 1 sidedata entries
1352 entry-0014 size 24
1353 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00uv'
1354 removed : u, ;
1355 added p1: v, u;
1319 ##### revision "mBAm-0 simple merge - A side" #####
1356 ##### revision "mBAm-0 simple merge - A side" #####
1320 1 sidedata entries
1357 1 sidedata entries
1321 entry-0014 size 4
1358 entry-0014 size 4
1322 '\x00\x00\x00\x00'
1359 '\x00\x00\x00\x00'
1323 ##### revision "mABm-0 simple merge - A side" #####
1360 ##### revision "mABm-0 simple merge - A side" #####
1324 1 sidedata entries
1361 1 sidedata entries
1325 entry-0014 size 4
1362 entry-0014 size 4
1326 '\x00\x00\x00\x00'
1363 '\x00\x00\x00\x00'
1327 ##### revision "mBCm-0 simple merge - C side" #####
1364 ##### revision "mBCm-0 simple merge - C side" #####
1328 1 sidedata entries
1365 1 sidedata entries
1329 entry-0014 size 4
1366 entry-0014 size 4
1330 '\x00\x00\x00\x00'
1367 '\x00\x00\x00\x00'
1331 ##### revision "mBCm-1 re-add d" #####
1368 ##### revision "mBCm-1 re-add d" #####
1332 1 sidedata entries
1369 1 sidedata entries
1333 entry-0014 size 14
1370 entry-0014 size 14
1334 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
1371 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
1335 added : d, ;
1372 added : d, ;
1336 ##### revision "mCBm-0 simple merge - C side" #####
1373 ##### revision "mCBm-0 simple merge - C side" #####
1337 1 sidedata entries
1374 1 sidedata entries
1338 entry-0014 size 4
1375 entry-0014 size 4
1339 '\x00\x00\x00\x00'
1376 '\x00\x00\x00\x00'
1340 ##### revision "mCBm-1 re-add d" #####
1377 ##### revision "mCBm-1 re-add d" #####
1341 1 sidedata entries
1378 1 sidedata entries
1342 entry-0014 size 14
1379 entry-0014 size 14
1343 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
1380 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
1344 added : d, ;
1381 added : d, ;
1345 ##### revision "mBDm-0 simple merge - B side" #####
1382 ##### revision "mBDm-0 simple merge - B side" #####
1346 1 sidedata entries
1383 1 sidedata entries
1347 entry-0014 size 4
1384 entry-0014 size 4
1348 '\x00\x00\x00\x00'
1385 '\x00\x00\x00\x00'
1349 ##### revision "mDBm-0 simple merge - B side" #####
1386 ##### revision "mDBm-0 simple merge - B side" #####
1350 1 sidedata entries
1387 1 sidedata entries
1351 entry-0014 size 4
1388 entry-0014 size 4
1352 '\x00\x00\x00\x00'
1389 '\x00\x00\x00\x00'
1353 ##### revision "mAEm-0 merge with copies info on both side - A side" #####
1390 ##### revision "mAEm-0 merge with copies info on both side - A side" #####
1354 1 sidedata entries
1391 1 sidedata entries
1355 entry-0014 size 14
1392 entry-0014 size 14
1356 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1393 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1357 merged : f, ;
1394 merged : f, ;
1358 ##### revision "mEAm-0 merge with copies info on both side - A side" #####
1395 ##### revision "mEAm-0 merge with copies info on both side - A side" #####
1359 1 sidedata entries
1396 1 sidedata entries
1360 entry-0014 size 14
1397 entry-0014 size 14
1361 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1398 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1362 merged : f, ;
1399 merged : f, ;
1363 ##### revision "f-1" #####
1400 ##### revision "f-1" #####
1364 1 sidedata entries
1401 1 sidedata entries
1365 entry-0014 size 24
1402 entry-0014 size 24
1366 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00hi'
1403 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00hi'
1367 removed : h, ;
1404 removed : h, ;
1368 added p1: i, h;
1405 added p1: i, h;
1369 ##### revision "f-2" #####
1406 ##### revision "f-2" #####
1370 1 sidedata entries
1407 1 sidedata entries
1371 entry-0014 size 24
1408 entry-0014 size 24
1372 '\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00di'
1409 '\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00di'
1373 touched p1: d, i;
1410 touched p1: d, i;
1374 removed : i, ;
1411 removed : i, ;
1375 ##### revision "mBFm-0 simple merge - B side" #####
1412 ##### revision "mBFm-0 simple merge - B side" #####
1376 1 sidedata entries
1413 1 sidedata entries
1377 entry-0014 size 4
1414 entry-0014 size 4
1378 '\x00\x00\x00\x00'
1415 '\x00\x00\x00\x00'
1379 ##### revision "mFBm-0 simple merge - B side" #####
1416 ##### revision "mFBm-0 simple merge - B side" #####
1380 1 sidedata entries
1417 1 sidedata entries
1381 entry-0014 size 4
1418 entry-0014 size 4
1382 '\x00\x00\x00\x00'
1419 '\x00\x00\x00\x00'
1383 ##### revision "g-1" #####
1420 ##### revision "g-1" #####
1384 1 sidedata entries
1421 1 sidedata entries
1385 entry-0014 size 14
1422 entry-0014 size 14
1386 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
1423 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
1387 touched : d, ;
1424 touched : d, ;
1388 ##### revision "mDGm-0 actual content merge, copies on one side - D side" #####
1425 ##### revision "mDGm-0 actual content merge, copies on one side - D side" #####
1389 1 sidedata entries
1426 1 sidedata entries
1390 entry-0014 size 14
1427 entry-0014 size 14
1391 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1428 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1392 merged : d, ;
1429 merged : d, ;
1393 ##### revision "mGDm-0 actual content merge, copies on one side - D side" #####
1430 ##### revision "mGDm-0 actual content merge, copies on one side - D side" #####
1394 1 sidedata entries
1431 1 sidedata entries
1395 entry-0014 size 14
1432 entry-0014 size 14
1396 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1433 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1397 merged : d, ;
1434 merged : d, ;
1398 ##### revision "mFGm-0 merge - G side" #####
1435 ##### revision "mFGm-0 merge - G side" #####
1399 1 sidedata entries
1436 1 sidedata entries
1400 entry-0014 size 14
1437 entry-0014 size 14
1401 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1438 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1402 merged : d, ;
1439 merged : d, ;
1403 ##### revision "mGFm-0 merge - G side" #####
1440 ##### revision "mGFm-0 merge - G side" #####
1404 1 sidedata entries
1441 1 sidedata entries
1405 entry-0014 size 14
1442 entry-0014 size 14
1406 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1443 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1407 merged : d, ;
1444 merged : d, ;
1408 ##### revision "mCGm-0 merge updated/deleted - revive the file (updated content) - one way" #####
1445 ##### revision "mCGm-0 merge updated/deleted - revive the file (updated content) - one way" #####
1409 1 sidedata entries
1446 1 sidedata entries
1410 entry-0014 size 14
1447 entry-0014 size 14
1411 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1448 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1412 salvaged : d, ;
1449 salvaged : d, ;
1413 ##### revision "mGCm-0 merge updated/deleted - revive the file (updated content) - the other way" #####
1450 ##### revision "mGCm-0 merge updated/deleted - revive the file (updated content) - the other way" #####
1414 1 sidedata entries
1451 1 sidedata entries
1415 entry-0014 size 14
1452 entry-0014 size 14
1416 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1453 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1417 salvaged : d, ;
1454 salvaged : d, ;
1418 ##### revision "mCB-revert-m-0 merge explicitely revive deleted file - B side" #####
1455 ##### revision "mCB-revert-m-0 merge explicitely revive deleted file - B side" #####
1419 1 sidedata entries
1456 1 sidedata entries
1420 entry-0014 size 14
1457 entry-0014 size 14
1421 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1458 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1422 salvaged : d, ;
1459 salvaged : d, ;
1423 ##### revision "mBC-revert-m-0 merge explicitely revive deleted file - B side" #####
1460 ##### revision "mBC-revert-m-0 merge explicitely revive deleted file - B side" #####
1424 1 sidedata entries
1461 1 sidedata entries
1425 entry-0014 size 14
1462 entry-0014 size 14
1426 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1463 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1427 salvaged : d, ;
1464 salvaged : d, ;
1428 ##### revision "h-1" #####
1465 ##### revision "h-1" #####
1429 1 sidedata entries
1466 1 sidedata entries
1430 entry-0014 size 24
1467 entry-0014 size 24
1431 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bd'
1468 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bd'
1432 removed : b, ;
1469 removed : b, ;
1433 added p1: d, b;
1470 added p1: d, b;
1434 ##### revision "mCH-delete-before-conflict-m-0 simple merge - C side" #####
1471 ##### revision "mCH-delete-before-conflict-m-0 simple merge - C side" #####
1435 1 sidedata entries
1472 1 sidedata entries
1436 entry-0014 size 4
1473 entry-0014 size 4
1437 '\x00\x00\x00\x00'
1474 '\x00\x00\x00\x00'
1438 ##### revision "mHC-delete-before-conflict-m-0 simple merge - C side" #####
1475 ##### revision "mHC-delete-before-conflict-m-0 simple merge - C side" #####
1439 1 sidedata entries
1476 1 sidedata entries
1440 entry-0014 size 4
1477 entry-0014 size 4
1441 '\x00\x00\x00\x00'
1478 '\x00\x00\x00\x00'
1442 ##### revision "mAE-change-m-0 merge with file update and copies info on both side - A side" #####
1479 ##### revision "mAE-change-m-0 merge with file update and copies info on both side - A side" #####
1443 1 sidedata entries
1480 1 sidedata entries
1444 entry-0014 size 14
1481 entry-0014 size 14
1445 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1482 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1446 merged : f, ;
1483 merged : f, ;
1447 ##### revision "mEA-change-m-0 merge with file update and copies info on both side - A side" #####
1484 ##### revision "mEA-change-m-0 merge with file update and copies info on both side - A side" #####
1448 1 sidedata entries
1485 1 sidedata entries
1449 entry-0014 size 14
1486 entry-0014 size 14
1450 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1487 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1451 merged : f, ;
1488 merged : f, ;
1452 ##### revision "j-1" #####
1489 ##### revision "j-1" #####
1453 1 sidedata entries
1490 1 sidedata entries
1454 entry-0014 size 24
1491 entry-0014 size 24
1455 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-j'
1492 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-j'
1456 added : unrelated-j, ;
1493 added : unrelated-j, ;
1457 ##### revision "k-1" #####
1494 ##### revision "k-1" #####
1458 1 sidedata entries
1495 1 sidedata entries
1459 entry-0014 size 24
1496 entry-0014 size 24
1460 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-k'
1497 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-k'
1461 added : unrelated-k, ;
1498 added : unrelated-k, ;
1462 ##### revision "mAE,Km" #####
1499 ##### revision "mAE,Km" #####
1463 1 sidedata entries
1500 1 sidedata entries
1464 entry-0014 size 4
1501 entry-0014 size 4
1465 '\x00\x00\x00\x00'
1502 '\x00\x00\x00\x00'
1466 ##### revision "mK,AEm" #####
1503 ##### revision "mK,AEm" #####
1467 1 sidedata entries
1504 1 sidedata entries
1468 entry-0014 size 4
1505 entry-0014 size 4
1469 '\x00\x00\x00\x00'
1506 '\x00\x00\x00\x00'
1470 ##### revision "mEA,Jm" #####
1507 ##### revision "mEA,Jm" #####
1471 1 sidedata entries
1508 1 sidedata entries
1472 entry-0014 size 4
1509 entry-0014 size 4
1473 '\x00\x00\x00\x00'
1510 '\x00\x00\x00\x00'
1474 ##### revision "mJ,EAm" #####
1511 ##### revision "mJ,EAm" #####
1475 1 sidedata entries
1512 1 sidedata entries
1476 entry-0014 size 4
1513 entry-0014 size 4
1477 '\x00\x00\x00\x00'
1514 '\x00\x00\x00\x00'
1478 ##### revision "l-1" #####
1515 ##### revision "l-1" #####
1479 1 sidedata entries
1516 1 sidedata entries
1480 entry-0014 size 24
1517 entry-0014 size 24
1481 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-l'
1518 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-l'
1482 added : unrelated-l, ;
1519 added : unrelated-l, ;
1483 ##### revision "mBC+revert,Lm" #####
1520 ##### revision "mBC+revert,Lm" #####
1484 1 sidedata entries
1521 1 sidedata entries
1485 entry-0014 size 4
1522 entry-0014 size 4
1486 '\x00\x00\x00\x00'
1523 '\x00\x00\x00\x00'
1487 ##### revision "mCB+revert,Lm" #####
1524 ##### revision "mCB+revert,Lm" #####
1488 1 sidedata entries
1525 1 sidedata entries
1489 entry-0014 size 4
1526 entry-0014 size 4
1490 '\x00\x00\x00\x00'
1527 '\x00\x00\x00\x00'
1491 ##### revision "mL,BC+revertm" #####
1528 ##### revision "mL,BC+revertm" #####
1492 1 sidedata entries
1529 1 sidedata entries
1493 entry-0014 size 4
1530 entry-0014 size 4
1494 '\x00\x00\x00\x00'
1531 '\x00\x00\x00\x00'
1495 ##### revision "mL,CB+revertm" #####
1532 ##### revision "mL,CB+revertm" #####
1496 1 sidedata entries
1533 1 sidedata entries
1497 entry-0014 size 4
1534 entry-0014 size 4
1498 '\x00\x00\x00\x00'
1535 '\x00\x00\x00\x00'
1499 ##### revision "n-1" #####
1536 ##### revision "n-1" #####
1500 1 sidedata entries
1537 1 sidedata entries
1501 entry-0014 size 24
1538 entry-0014 size 24
1502 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-n'
1539 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-n'
1503 added : unrelated-n, ;
1540 added : unrelated-n, ;
1504 ##### revision "o-1" #####
1541 ##### revision "o-1" #####
1505 1 sidedata entries
1542 1 sidedata entries
1506 entry-0014 size 24
1543 entry-0014 size 24
1507 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-o'
1544 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-o'
1508 added : unrelated-o, ;
1545 added : unrelated-o, ;
1509 ##### revision "mFG,Om" #####
1546 ##### revision "mFG,Om" #####
1510 1 sidedata entries
1547 1 sidedata entries
1511 entry-0014 size 4
1548 entry-0014 size 4
1512 '\x00\x00\x00\x00'
1549 '\x00\x00\x00\x00'
1513 ##### revision "mO,FGm" #####
1550 ##### revision "mO,FGm" #####
1514 1 sidedata entries
1551 1 sidedata entries
1515 entry-0014 size 4
1552 entry-0014 size 4
1516 '\x00\x00\x00\x00'
1553 '\x00\x00\x00\x00'
1517 ##### revision "mGF,Nm" #####
1554 ##### revision "mGF,Nm" #####
1518 1 sidedata entries
1555 1 sidedata entries
1519 entry-0014 size 4
1556 entry-0014 size 4
1520 '\x00\x00\x00\x00'
1557 '\x00\x00\x00\x00'
1521 ##### revision "mN,GFm" #####
1558 ##### revision "mN,GFm" #####
1522 1 sidedata entries
1559 1 sidedata entries
1523 entry-0014 size 4
1560 entry-0014 size 4
1524 '\x00\x00\x00\x00'
1561 '\x00\x00\x00\x00'
1525 ##### revision "mAE-change,Km" #####
1562 ##### revision "mAE-change,Km" #####
1526 1 sidedata entries
1563 1 sidedata entries
1527 entry-0014 size 4
1564 entry-0014 size 4
1528 '\x00\x00\x00\x00'
1565 '\x00\x00\x00\x00'
1529 ##### revision "mK,AE-change-m" #####
1566 ##### revision "mK,AE-change-m" #####
1530 1 sidedata entries
1567 1 sidedata entries
1531 entry-0014 size 4
1568 entry-0014 size 4
1532 '\x00\x00\x00\x00'
1569 '\x00\x00\x00\x00'
1533 ##### revision "mEA-change,Jm" #####
1570 ##### revision "mEA-change,Jm" #####
1534 1 sidedata entries
1571 1 sidedata entries
1535 entry-0014 size 4
1572 entry-0014 size 4
1536 '\x00\x00\x00\x00'
1573 '\x00\x00\x00\x00'
1537 ##### revision "mJ,EA-change-m" #####
1574 ##### revision "mJ,EA-change-m" #####
1538 1 sidedata entries
1575 1 sidedata entries
1539 entry-0014 size 4
1576 entry-0014 size 4
1540 '\x00\x00\x00\x00'
1577 '\x00\x00\x00\x00'
1541
1578
1542 #endif
1579 #endif
1543
1580
1544
1581
1545 Test copy information chaining
1582 Test copy information chaining
1546 ==============================
1583 ==============================
1547
1584
1548 Check that matching only affect the destination and not intermediate path
1585 Check that matching only affect the destination and not intermediate path
1549 -------------------------------------------------------------------------
1586 -------------------------------------------------------------------------
1550
1587
1551 The two status call should give the same value for f
1588 The two status call should give the same value for f
1552
1589
1553 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")'
1590 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")'
1554 A f
1591 A f
1555 a
1592 a
1556 A t
1593 A t
1557 p
1594 p
1558 R a
1595 R a
1559 R p
1596 R p
1560 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")' f
1597 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")' f
1561 A f
1598 A f
1562 a (no-changeset no-compatibility !)
1599 a (no-changeset no-compatibility !)
1563
1600
1564 merging with unrelated change does not interfere with the renames
1601 merging with unrelated change does not interfere with the renames
1565 ---------------------------------------------------------------
1602 ---------------------------------------------------------------
1566
1603
1567 - rename on one side
1604 - rename on one side
1568 - unrelated change on the other side
1605 - unrelated change on the other side
1569
1606
1570 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
1607 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
1571 o mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
1608 o mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
1572 |\
1609 |\
1573 +---o mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
1610 +---o mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
1574 | |/
1611 | |/
1575 | o b-1: b update
1612 | o b-1: b update
1576 | |
1613 | |
1577 o | a-2: e -move-> f
1614 o | a-2: e -move-> f
1578 | |
1615 | |
1579 o | a-1: d -move-> e
1616 o | a-1: d -move-> e
1580 |/
1617 |/
1581 o i-2: c -move-> d, s -move-> t
1618 o i-2: c -move-> d, s -move-> t
1582 |
1619 |
1583 o i-1: a -move-> c, p -move-> s
1620 o i-1: a -move-> c, p -move-> s
1584 |
1621 |
1585 o i-0 initial commit: a b h
1622 o i-0 initial commit: a b h
1586
1623
1587
1624
1588 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
1625 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
1589 A f
1626 A f
1590 d
1627 d
1591 R d
1628 R d
1592 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
1629 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
1593 A f
1630 A f
1594 d
1631 d
1595 R d
1632 R d
1596 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
1633 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
1597 M b
1634 M b
1598 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
1635 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
1599 M b
1636 M b
1600 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
1637 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
1601 M b
1638 M b
1602 A f
1639 A f
1603 d
1640 d
1604 R d
1641 R d
1605 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
1642 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
1606 M b
1643 M b
1607 A f
1644 A f
1608 d
1645 d
1609 R d
1646 R d
1610 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
1647 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
1611 M b
1648 M b
1612 A f
1649 A f
1613 a
1650 a
1614 A t
1651 A t
1615 p
1652 p
1616 R a
1653 R a
1617 R p
1654 R p
1618 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
1655 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
1619 M b
1656 M b
1620 A f
1657 A f
1621 a
1658 a
1622 A t
1659 A t
1623 p
1660 p
1624 R a
1661 R a
1625 R p
1662 R p
1626
1663
1627 merging with the side having a delete
1664 merging with the side having a delete
1628 -------------------------------------
1665 -------------------------------------
1629
1666
1630 case summary:
1667 case summary:
1631 - one with change to an unrelated file
1668 - one with change to an unrelated file
1632 - one deleting the change
1669 - one deleting the change
1633 and recreate an unrelated file after the merge
1670 and recreate an unrelated file after the merge
1634
1671
1635 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
1672 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
1636 o mCBm-1 re-add d
1673 o mCBm-1 re-add d
1637 |
1674 |
1638 o mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
1675 o mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
1639 |\
1676 |\
1640 | | o mBCm-1 re-add d
1677 | | o mBCm-1 re-add d
1641 | | |
1678 | | |
1642 +---o mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
1679 +---o mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
1643 | |/
1680 | |/
1644 | o c-1 delete d
1681 | o c-1 delete d
1645 | |
1682 | |
1646 o | b-1: b update
1683 o | b-1: b update
1647 |/
1684 |/
1648 o i-2: c -move-> d, s -move-> t
1685 o i-2: c -move-> d, s -move-> t
1649 |
1686 |
1650 o i-1: a -move-> c, p -move-> s
1687 o i-1: a -move-> c, p -move-> s
1651 |
1688 |
1652 o i-0 initial commit: a b h
1689 o i-0 initial commit: a b h
1653
1690
1654 - comparing from the merge
1691 - comparing from the merge
1655
1692
1656 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
1693 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
1657 R d
1694 R d
1658 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
1695 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
1659 R d
1696 R d
1660 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
1697 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
1661 M b
1698 M b
1662 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
1699 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
1663 M b
1700 M b
1664 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
1701 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
1665 M b
1702 M b
1666 R d
1703 R d
1667 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
1704 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
1668 M b
1705 M b
1669 R d
1706 R d
1670 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
1707 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
1671 M b
1708 M b
1672 A t
1709 A t
1673 p
1710 p
1674 R a
1711 R a
1675 R p
1712 R p
1676 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
1713 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
1677 M b
1714 M b
1678 A t
1715 A t
1679 p
1716 p
1680 R a
1717 R a
1681 R p
1718 R p
1682
1719
1683 - comparing with the merge children re-adding the file
1720 - comparing with the merge children re-adding the file
1684
1721
1685 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
1722 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
1686 M d
1723 M d
1687 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
1724 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
1688 M d
1725 M d
1689 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
1726 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
1690 M b
1727 M b
1691 A d
1728 A d
1692 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
1729 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
1693 M b
1730 M b
1694 A d
1731 A d
1695 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
1732 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
1696 M b
1733 M b
1697 M d
1734 M d
1698 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
1735 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
1699 M b
1736 M b
1700 M d
1737 M d
1701 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
1738 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
1702 M b
1739 M b
1703 A d
1740 A d
1704 A t
1741 A t
1705 p
1742 p
1706 R a
1743 R a
1707 R p
1744 R p
1708 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
1745 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
1709 M b
1746 M b
1710 A d
1747 A d
1711 A t
1748 A t
1712 p
1749 p
1713 R a
1750 R a
1714 R p
1751 R p
1715
1752
1716 Comparing with a merge re-adding the file afterward
1753 Comparing with a merge re-adding the file afterward
1717 ---------------------------------------------------
1754 ---------------------------------------------------
1718
1755
1719 Merge:
1756 Merge:
1720 - one with change to an unrelated file
1757 - one with change to an unrelated file
1721 - one deleting and recreating the change
1758 - one deleting and recreating the change
1722
1759
1723 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
1760 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
1724 o mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
1761 o mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
1725 |\
1762 |\
1726 +---o mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
1763 +---o mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
1727 | |/
1764 | |/
1728 | o d-2 re-add d
1765 | o d-2 re-add d
1729 | |
1766 | |
1730 | o d-1 delete d
1767 | o d-1 delete d
1731 | |
1768 | |
1732 o | b-1: b update
1769 o | b-1: b update
1733 |/
1770 |/
1734 o i-2: c -move-> d, s -move-> t
1771 o i-2: c -move-> d, s -move-> t
1735 |
1772 |
1736 o i-1: a -move-> c, p -move-> s
1773 o i-1: a -move-> c, p -move-> s
1737 |
1774 |
1738 o i-0 initial commit: a b h
1775 o i-0 initial commit: a b h
1739
1776
1740 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
1777 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
1741 M d
1778 M d
1742 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
1779 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
1743 M d
1780 M d
1744 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
1781 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
1745 M b
1782 M b
1746 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
1783 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
1747 M b
1784 M b
1748 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
1785 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
1749 M b
1786 M b
1750 M d
1787 M d
1751 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
1788 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
1752 M b
1789 M b
1753 M d
1790 M d
1754
1791
1755 The bugs makes recorded copy is different depending of where we started the merge from since
1792 The bugs makes recorded copy is different depending of where we started the merge from since
1756
1793
1757 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
1794 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
1758 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1795 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1759 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
1796 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
1760 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1797 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1761
1798
1762 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
1799 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
1763 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1800 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1764 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
1801 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
1765 d8252ab2e760b0d4e5288fd44cbd15a0fa567e16 644 d (no-changeset !)
1802 d8252ab2e760b0d4e5288fd44cbd15a0fa567e16 644 d (no-changeset !)
1766 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
1803 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
1767 $ hg debugindex d | head -n 4 | ../no-linkrev
1804 $ hg debugindex d | head -n 4 | ../no-linkrev
1768 rev linkrev nodeid p1 p2
1805 rev linkrev nodeid p1 p2
1769 0 * d8252ab2e760 000000000000 000000000000 (no-changeset !)
1806 0 * d8252ab2e760 000000000000 000000000000 (no-changeset !)
1770 0 * ae258f702dfe 000000000000 000000000000 (changeset !)
1807 0 * ae258f702dfe 000000000000 000000000000 (changeset !)
1771 1 * b004912a8510 000000000000 000000000000
1808 1 * b004912a8510 000000000000 000000000000
1772 2 * 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
1809 2 * 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
1773 2 * 5cce88bf349f ae258f702dfe 000000000000 (changeset !)
1810 2 * 5cce88bf349f ae258f702dfe 000000000000 (changeset !)
1774
1811
1775 Log output should not include a merge commit as it did not happen
1812 Log output should not include a merge commit as it did not happen
1776
1813
1777 $ hg log -Gfr 'desc("mBDm-0")' d
1814 $ hg log -Gfr 'desc("mBDm-0")' d
1778 o d-2 re-add d
1815 o d-2 re-add d
1779 |
1816 |
1780 ~
1817 ~
1781
1818
1782 $ hg log -Gfr 'desc("mDBm-0")' d
1819 $ hg log -Gfr 'desc("mDBm-0")' d
1783 o d-2 re-add d
1820 o d-2 re-add d
1784 |
1821 |
1785 ~
1822 ~
1786
1823
1787 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
1824 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
1788 M b
1825 M b
1789 A d
1826 A d
1790 A t
1827 A t
1791 p
1828 p
1792 R a
1829 R a
1793 R p
1830 R p
1794 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
1831 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
1795 M b
1832 M b
1796 A d
1833 A d
1797 A t
1834 A t
1798 p
1835 p
1799 R a
1836 R a
1800 R p
1837 R p
1801
1838
1802
1839
1803 Comparing with a merge with colliding rename
1840 Comparing with a merge with colliding rename
1804 --------------------------------------------
1841 --------------------------------------------
1805
1842
1806 Subcase: new copy information on both side
1843 Subcase: new copy information on both side
1807 ``````````````````````````````````````````
1844 ``````````````````````````````````````````
1808
1845
1809 - the "e-" branch renaming b to f (through 'g')
1846 - the "e-" branch renaming b to f (through 'g')
1810 - the "a-" branch renaming d to f (through e)
1847 - the "a-" branch renaming d to f (through e)
1811
1848
1812 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
1849 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
1813 o mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
1850 o mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
1814 |\
1851 |\
1815 +---o mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
1852 +---o mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
1816 | |/
1853 | |/
1817 | o e-2 g -move-> f
1854 | o e-2 g -move-> f
1818 | |
1855 | |
1819 | o e-1 b -move-> g
1856 | o e-1 b -move-> g
1820 | |
1857 | |
1821 o | a-2: e -move-> f
1858 o | a-2: e -move-> f
1822 | |
1859 | |
1823 o | a-1: d -move-> e
1860 o | a-1: d -move-> e
1824 |/
1861 |/
1825 o i-2: c -move-> d, s -move-> t
1862 o i-2: c -move-> d, s -move-> t
1826 |
1863 |
1827 o i-1: a -move-> c, p -move-> s
1864 o i-1: a -move-> c, p -move-> s
1828 |
1865 |
1829 o i-0 initial commit: a b h
1866 o i-0 initial commit: a b h
1830
1867
1831 #if no-changeset
1868 #if no-changeset
1832 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1869 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1833 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1870 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1834 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1871 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1835 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1872 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1836 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1873 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1837 b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f
1874 b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f
1838 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1875 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1839 e8825b386367b29fec957283a80bb47b47483fe1 644 f
1876 e8825b386367b29fec957283a80bb47b47483fe1 644 f
1840 $ hg debugindex f | ../no-linkrev
1877 $ hg debugindex f | ../no-linkrev
1841 rev linkrev nodeid p1 p2
1878 rev linkrev nodeid p1 p2
1842 0 * b76eb76580df 000000000000 000000000000
1879 0 * b76eb76580df 000000000000 000000000000
1843 1 * e8825b386367 000000000000 000000000000
1880 1 * e8825b386367 000000000000 000000000000
1844 2 * 2ff93c643948 b76eb76580df e8825b386367
1881 2 * 2ff93c643948 b76eb76580df e8825b386367
1845 3 * 2f649fba7eb2 b76eb76580df e8825b386367
1882 3 * 2f649fba7eb2 b76eb76580df e8825b386367
1846 4 * 774e7c1637d5 e8825b386367 b76eb76580df
1883 4 * 774e7c1637d5 e8825b386367 b76eb76580df
1847 #else
1884 #else
1848 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1885 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1849 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1886 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1850 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1887 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1851 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1888 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1852 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1889 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1853 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1890 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1854 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1891 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1855 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1892 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1856 $ hg debugindex f | ../no-linkrev
1893 $ hg debugindex f | ../no-linkrev
1857 rev linkrev nodeid p1 p2
1894 rev linkrev nodeid p1 p2
1858 0 * ae258f702dfe 000000000000 000000000000
1895 0 * ae258f702dfe 000000000000 000000000000
1859 1 * d3613c1ec831 ae258f702dfe 000000000000
1896 1 * d3613c1ec831 ae258f702dfe 000000000000
1860 2 * 05e03c868bbc ae258f702dfe 000000000000
1897 2 * 05e03c868bbc ae258f702dfe 000000000000
1861 #endif
1898 #endif
1862
1899
1863 # Here the filelog based implementation is not looking at the rename
1900 # Here the filelog based implementation is not looking at the rename
1864 # information (because the file exist on both side). However the changelog
1901 # information (because the file exist on both side). However the changelog
1865 # based on works fine. We have different output.
1902 # based on works fine. We have different output.
1866
1903
1867 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
1904 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
1868 M f (no-changeset !)
1905 M f (no-changeset !)
1869 b (no-filelog no-changeset !)
1906 b (no-filelog no-changeset !)
1870 R b
1907 R b
1871 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
1908 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
1872 M f (no-changeset !)
1909 M f (no-changeset !)
1873 b (no-filelog no-changeset !)
1910 b (no-filelog no-changeset !)
1874 R b
1911 R b
1875 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
1912 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
1876 M f (no-changeset !)
1913 M f (no-changeset !)
1877 d (no-filelog no-changeset !)
1914 d (no-filelog no-changeset !)
1878 R d
1915 R d
1879 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
1916 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
1880 M f (no-changeset !)
1917 M f (no-changeset !)
1881 d (no-filelog no-changeset !)
1918 d (no-filelog no-changeset !)
1882 R d
1919 R d
1883 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
1920 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
1884 A f
1921 A f
1885 d
1922 d
1886 R d
1923 R d
1887 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
1924 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
1888 A f
1925 A f
1889 b
1926 b
1890 R b
1927 R b
1891
1928
1892 # From here, we run status against revision where both source file exists.
1929 # From here, we run status against revision where both source file exists.
1893 #
1930 #
1894 # The filelog based implementation picks an arbitrary side based on revision
1931 # The filelog based implementation picks an arbitrary side based on revision
1895 # numbers. So the same side "wins" whatever the parents order is. This is
1932 # numbers. So the same side "wins" whatever the parents order is. This is
1896 # sub-optimal because depending on revision numbers means the result can be
1933 # sub-optimal because depending on revision numbers means the result can be
1897 # different from one repository to the next.
1934 # different from one repository to the next.
1898 #
1935 #
1899 # The changeset based algorithm use the parent order to break tie on conflicting
1936 # The changeset based algorithm use the parent order to break tie on conflicting
1900 # information and will have a different order depending on who is p1 and p2.
1937 # information and will have a different order depending on who is p1 and p2.
1901 # That order is stable accross repositories. (data from p1 prevails)
1938 # That order is stable accross repositories. (data from p1 prevails)
1902
1939
1903 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
1940 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
1904 A f
1941 A f
1905 d
1942 d
1906 R b
1943 R b
1907 R d
1944 R d
1908 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
1945 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
1909 A f
1946 A f
1910 d (filelog !)
1947 d (filelog !)
1911 b (no-filelog !)
1948 b (no-filelog !)
1912 R b
1949 R b
1913 R d
1950 R d
1914 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
1951 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
1915 A f
1952 A f
1916 a
1953 a
1917 A t
1954 A t
1918 p
1955 p
1919 R a
1956 R a
1920 R b
1957 R b
1921 R p
1958 R p
1922 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
1959 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
1923 A f
1960 A f
1924 a (filelog !)
1961 a (filelog !)
1925 b (no-filelog !)
1962 b (no-filelog !)
1926 A t
1963 A t
1927 p
1964 p
1928 R a
1965 R a
1929 R b
1966 R b
1930 R p
1967 R p
1931
1968
1932
1969
1933 Subcase: existing copy information overwritten on one branch
1970 Subcase: existing copy information overwritten on one branch
1934 ````````````````````````````````````````````````````````````
1971 ````````````````````````````````````````````````````````````
1935
1972
1936 Note:
1973 Note:
1937 | In this case, one of the merge wrongly record a merge while there is none.
1974 | In this case, one of the merge wrongly record a merge while there is none.
1938 | This lead to bad copy tracing information to be dug up.
1975 | This lead to bad copy tracing information to be dug up.
1939
1976
1940
1977
1941 Merge:
1978 Merge:
1942 - one with change to an unrelated file (b)
1979 - one with change to an unrelated file (b)
1943 - one overwriting a file (d) with a rename (from h to i to d)
1980 - one overwriting a file (d) with a rename (from h to i to d)
1944
1981
1945 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
1982 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
1946 o mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
1983 o mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
1947 |\
1984 |\
1948 +---o mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
1985 +---o mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
1949 | |/
1986 | |/
1950 | o f-2: rename i -> d
1987 | o f-2: rename i -> d
1951 | |
1988 | |
1952 | o f-1: rename h -> i
1989 | o f-1: rename h -> i
1953 | |
1990 | |
1954 o | b-1: b update
1991 o | b-1: b update
1955 |/
1992 |/
1956 o i-2: c -move-> d, s -move-> t
1993 o i-2: c -move-> d, s -move-> t
1957 |
1994 |
1958 o i-1: a -move-> c, p -move-> s
1995 o i-1: a -move-> c, p -move-> s
1959 |
1996 |
1960 o i-0 initial commit: a b h
1997 o i-0 initial commit: a b h
1961
1998
1962 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
1999 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
1963 M b
2000 M b
1964 A d
2001 A d
1965 h
2002 h
1966 A t
2003 A t
1967 p
2004 p
1968 R a
2005 R a
1969 R h
2006 R h
1970 R p
2007 R p
1971 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
2008 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
1972 M b
2009 M b
1973 A d
2010 A d
1974 h
2011 h
1975 A t
2012 A t
1976 p
2013 p
1977 R a
2014 R a
1978 R h
2015 R h
1979 R p
2016 R p
1980 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
2017 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
1981 M d (no-changeset !)
2018 M d (no-changeset !)
1982 h (no-filelog no-changeset !)
2019 h (no-filelog no-changeset !)
1983 R h
2020 R h
1984 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
2021 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
1985 M b
2022 M b
1986 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
2023 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
1987 M b
2024 M b
1988 M d (no-changeset !)
2025 M d (no-changeset !)
1989 i (no-filelog no-changeset !)
2026 i (no-filelog no-changeset !)
1990 R i
2027 R i
1991 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
2028 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
1992 M d (no-changeset !)
2029 M d (no-changeset !)
1993 h (no-filelog no-changeset !)
2030 h (no-filelog no-changeset !)
1994 R h
2031 R h
1995 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
2032 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
1996 M b
2033 M b
1997 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
2034 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
1998 M b
2035 M b
1999 M d (no-changeset !)
2036 M d (no-changeset !)
2000 i (no-filelog no-changeset !)
2037 i (no-filelog no-changeset !)
2001 R i
2038 R i
2002
2039
2003 #if no-changeset
2040 #if no-changeset
2004 $ hg log -Gfr 'desc("mBFm-0")' d
2041 $ hg log -Gfr 'desc("mBFm-0")' d
2005 o f-2: rename i -> d
2042 o f-2: rename i -> d
2006 |
2043 |
2007 o f-1: rename h -> i
2044 o f-1: rename h -> i
2008 :
2045 :
2009 o i-0 initial commit: a b h
2046 o i-0 initial commit: a b h
2010
2047
2011 #else
2048 #else
2012 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2049 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2013 $ hg log -Gfr 'desc("mBFm-0")' d
2050 $ hg log -Gfr 'desc("mBFm-0")' d
2014 o i-2: c -move-> d, s -move-> t
2051 o i-2: c -move-> d, s -move-> t
2015 |
2052 |
2016 ~
2053 ~
2017 #endif
2054 #endif
2018
2055
2019 #if no-changeset
2056 #if no-changeset
2020 $ hg log -Gfr 'desc("mFBm-0")' d
2057 $ hg log -Gfr 'desc("mFBm-0")' d
2021 o f-2: rename i -> d
2058 o f-2: rename i -> d
2022 |
2059 |
2023 o f-1: rename h -> i
2060 o f-1: rename h -> i
2024 :
2061 :
2025 o i-0 initial commit: a b h
2062 o i-0 initial commit: a b h
2026
2063
2027 #else
2064 #else
2028 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2065 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2029 $ hg log -Gfr 'desc("mFBm-0")' d
2066 $ hg log -Gfr 'desc("mFBm-0")' d
2030 o i-2: c -move-> d, s -move-> t
2067 o i-2: c -move-> d, s -move-> t
2031 |
2068 |
2032 ~
2069 ~
2033 #endif
2070 #endif
2034
2071
2035 Subcase: reset of the copy history on one side
2072 Subcase: reset of the copy history on one side
2036 ``````````````````````````````````````````````
2073 ``````````````````````````````````````````````
2037
2074
2038 Merge:
2075 Merge:
2039 - one with change to a file
2076 - one with change to a file
2040 - one deleting and recreating the file
2077 - one deleting and recreating the file
2041
2078
2042 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
2079 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
2043 consider history and rename on both branch of the merge.
2080 consider history and rename on both branch of the merge.
2044
2081
2045 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
2082 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
2046 o mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
2083 o mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
2047 |\
2084 |\
2048 +---o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2085 +---o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2049 | |/
2086 | |/
2050 | o g-1: update d
2087 | o g-1: update d
2051 | |
2088 | |
2052 o | d-2 re-add d
2089 o | d-2 re-add d
2053 | |
2090 | |
2054 o | d-1 delete d
2091 o | d-1 delete d
2055 |/
2092 |/
2056 o i-2: c -move-> d, s -move-> t
2093 o i-2: c -move-> d, s -move-> t
2057 |
2094 |
2058 o i-1: a -move-> c, p -move-> s
2095 o i-1: a -move-> c, p -move-> s
2059 |
2096 |
2060 o i-0 initial commit: a b h
2097 o i-0 initial commit: a b h
2061
2098
2062 One side of the merge have a long history with rename. The other side of the
2099 One side of the merge have a long history with rename. The other side of the
2063 merge point to a new file with a smaller history. Each side is "valid".
2100 merge point to a new file with a smaller history. Each side is "valid".
2064
2101
2065 (and again the filelog based algorithm only explore one, with a pick based on
2102 (and again the filelog based algorithm only explore one, with a pick based on
2066 revision numbers)
2103 revision numbers)
2067
2104
2068 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
2105 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
2069 A d
2106 A d
2070 a (filelog !)
2107 a (filelog !)
2071 A t
2108 A t
2072 p
2109 p
2073 R a
2110 R a
2074 R p
2111 R p
2075 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
2112 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
2076 A d
2113 A d
2077 a
2114 a
2078 A t
2115 A t
2079 p
2116 p
2080 R a
2117 R a
2081 R p
2118 R p
2082 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
2119 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
2083 M d
2120 M d
2084 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
2121 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
2085 M d
2122 M d
2086 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
2123 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
2087 M d
2124 M d
2088 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
2125 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
2089 M d
2126 M d
2090
2127
2091 #if no-changeset
2128 #if no-changeset
2092 $ hg log -Gfr 'desc("mDGm-0")' d
2129 $ hg log -Gfr 'desc("mDGm-0")' d
2093 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2130 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2094 |\
2131 |\
2095 | o g-1: update d
2132 | o g-1: update d
2096 | |
2133 | |
2097 o | d-2 re-add d
2134 o | d-2 re-add d
2098 |/
2135 |/
2099 o i-2: c -move-> d, s -move-> t
2136 o i-2: c -move-> d, s -move-> t
2100 |
2137 |
2101 o i-1: a -move-> c, p -move-> s
2138 o i-1: a -move-> c, p -move-> s
2102 |
2139 |
2103 o i-0 initial commit: a b h
2140 o i-0 initial commit: a b h
2104
2141
2105 #else
2142 #else
2106 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2143 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2107 $ hg log -Gfr 'desc("mDGm-0")' d
2144 $ hg log -Gfr 'desc("mDGm-0")' d
2108 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2145 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2109 |\
2146 |\
2110 | o g-1: update d
2147 | o g-1: update d
2111 | |
2148 | |
2112 o | d-2 re-add d
2149 o | d-2 re-add d
2113 |/
2150 |/
2114 o i-2: c -move-> d, s -move-> t
2151 o i-2: c -move-> d, s -move-> t
2115 |
2152 |
2116 ~
2153 ~
2117 #endif
2154 #endif
2118
2155
2119
2156
2120 #if no-changeset
2157 #if no-changeset
2121 $ hg log -Gfr 'desc("mDGm-0")' d
2158 $ hg log -Gfr 'desc("mDGm-0")' d
2122 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2159 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2123 |\
2160 |\
2124 | o g-1: update d
2161 | o g-1: update d
2125 | |
2162 | |
2126 o | d-2 re-add d
2163 o | d-2 re-add d
2127 |/
2164 |/
2128 o i-2: c -move-> d, s -move-> t
2165 o i-2: c -move-> d, s -move-> t
2129 |
2166 |
2130 o i-1: a -move-> c, p -move-> s
2167 o i-1: a -move-> c, p -move-> s
2131 |
2168 |
2132 o i-0 initial commit: a b h
2169 o i-0 initial commit: a b h
2133
2170
2134 #else
2171 #else
2135 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2172 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2136 $ hg log -Gfr 'desc("mDGm-0")' d
2173 $ hg log -Gfr 'desc("mDGm-0")' d
2137 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2174 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2138 |\
2175 |\
2139 | o g-1: update d
2176 | o g-1: update d
2140 | |
2177 | |
2141 o | d-2 re-add d
2178 o | d-2 re-add d
2142 |/
2179 |/
2143 o i-2: c -move-> d, s -move-> t
2180 o i-2: c -move-> d, s -move-> t
2144 |
2181 |
2145 ~
2182 ~
2146 #endif
2183 #endif
2147
2184
2148 Subcase: merging a change to a file with a "copy overwrite" to that file from another branch
2185 Subcase: merging a change to a file with a "copy overwrite" to that file from another branch
2149 ````````````````````````````````````````````````````````````````````````````````````````````
2186 ````````````````````````````````````````````````````````````````````````````````````````````
2150
2187
2151 Merge:
2188 Merge:
2152 - one with change to a file (d)
2189 - one with change to a file (d)
2153 - one overwriting that file with a rename (from h to i, to d)
2190 - one overwriting that file with a rename (from h to i, to d)
2154
2191
2155 This case is similar to BF/FB, but an actual merge happens, so both side of the
2192 This case is similar to BF/FB, but an actual merge happens, so both side of the
2156 history are relevant.
2193 history are relevant.
2157
2194
2158
2195
2159 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
2196 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
2160 o mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
2197 o mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
2161 |\
2198 |\
2162 +---o mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
2199 +---o mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
2163 | |/
2200 | |/
2164 | o g-1: update d
2201 | o g-1: update d
2165 | |
2202 | |
2166 o | f-2: rename i -> d
2203 o | f-2: rename i -> d
2167 | |
2204 | |
2168 o | f-1: rename h -> i
2205 o | f-1: rename h -> i
2169 |/
2206 |/
2170 o i-2: c -move-> d, s -move-> t
2207 o i-2: c -move-> d, s -move-> t
2171 |
2208 |
2172 o i-1: a -move-> c, p -move-> s
2209 o i-1: a -move-> c, p -move-> s
2173 |
2210 |
2174 o i-0 initial commit: a b h
2211 o i-0 initial commit: a b h
2175
2212
2176
2213
2177 Note:
2214 Note:
2178 | In this case, the merge get conflicting information since on one side we have
2215 | In this case, the merge get conflicting information since on one side we have
2179 | "a -> c -> d". and one the other one we have "h -> i -> d".
2216 | "a -> c -> d". and one the other one we have "h -> i -> d".
2180 |
2217 |
2181 | The current code arbitrarily pick one side depending the ordering of the merged hash:
2218 | The current code arbitrarily pick one side depending the ordering of the merged hash:
2182
2219
2183 In this case, the file hash from "f-2" is lower, so it will be `p1` of the resulting filenode its copy tracing information will win (and trace back to "h"):
2220 In this case, the file hash from "f-2" is lower, so it will be `p1` of the resulting filenode its copy tracing information will win (and trace back to "h"):
2184
2221
2185 Details on this hash ordering pick:
2222 Details on this hash ordering pick:
2186
2223
2187 $ hg manifest --debug 'desc("g-1")' | egrep 'd$'
2224 $ hg manifest --debug 'desc("g-1")' | egrep 'd$'
2188 17ec97e605773eb44a117d1136b3849bcdc1924f 644 d (no-changeset !)
2225 17ec97e605773eb44a117d1136b3849bcdc1924f 644 d (no-changeset !)
2189 5cce88bf349f7c742bb440f2c53f81db9c294279 644 d (changeset !)
2226 5cce88bf349f7c742bb440f2c53f81db9c294279 644 d (changeset !)
2190 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("g-1")' d
2227 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("g-1")' d
2191 A d
2228 A d
2192 a (no-changeset no-compatibility !)
2229 a (no-changeset no-compatibility !)
2193
2230
2194 $ hg manifest --debug 'desc("f-2")' | egrep 'd$'
2231 $ hg manifest --debug 'desc("f-2")' | egrep 'd$'
2195 7b79e2fe0c8924e0e598a82f048a7b024afa4d96 644 d (no-changeset !)
2232 7b79e2fe0c8924e0e598a82f048a7b024afa4d96 644 d (no-changeset !)
2196 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
2233 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
2197 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("f-2")' d
2234 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("f-2")' d
2198 A d
2235 A d
2199 h (no-changeset no-compatibility !)
2236 h (no-changeset no-compatibility !)
2200
2237
2201 Copy tracing data on the resulting merge:
2238 Copy tracing data on the resulting merge:
2202
2239
2203 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
2240 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
2204 A d
2241 A d
2205 h (no-filelog !)
2242 h (no-filelog !)
2206 a (filelog !)
2243 a (filelog !)
2207 A t
2244 A t
2208 p
2245 p
2209 R a
2246 R a
2210 R h
2247 R h
2211 R p
2248 R p
2212 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
2249 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
2213 A d
2250 A d
2214 a (no-changeset !)
2251 a (no-changeset !)
2215 h (changeset !)
2252 h (changeset !)
2216 A t
2253 A t
2217 p
2254 p
2218 R a
2255 R a
2219 R h
2256 R h
2220 R p
2257 R p
2221 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
2258 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
2222 M d
2259 M d
2223 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
2260 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
2224 M d
2261 M d
2225 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
2262 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
2226 M d
2263 M d
2227 i (no-filelog !)
2264 i (no-filelog !)
2228 R i
2265 R i
2229 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
2266 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
2230 M d
2267 M d
2231 i (no-filelog !)
2268 i (no-filelog !)
2232 R i
2269 R i
2233 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
2270 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
2234 M d (no-changeset !)
2271 M d (no-changeset !)
2235 h (no-filelog no-changeset !)
2272 h (no-filelog no-changeset !)
2236 R h
2273 R h
2237 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
2274 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
2238 M d (no-changeset !)
2275 M d (no-changeset !)
2239 h (no-filelog no-changeset !)
2276 h (no-filelog no-changeset !)
2240 R h
2277 R h
2241
2278
2242 #if no-changeset
2279 #if no-changeset
2243 $ hg log -Gfr 'desc("mFGm-0")' d
2280 $ hg log -Gfr 'desc("mFGm-0")' d
2244 o mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
2281 o mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
2245 |\
2282 |\
2246 | o g-1: update d
2283 | o g-1: update d
2247 | |
2284 | |
2248 o | f-2: rename i -> d
2285 o | f-2: rename i -> d
2249 | |
2286 | |
2250 o | f-1: rename h -> i
2287 o | f-1: rename h -> i
2251 |/
2288 |/
2252 o i-2: c -move-> d, s -move-> t
2289 o i-2: c -move-> d, s -move-> t
2253 |
2290 |
2254 o i-1: a -move-> c, p -move-> s
2291 o i-1: a -move-> c, p -move-> s
2255 |
2292 |
2256 o i-0 initial commit: a b h
2293 o i-0 initial commit: a b h
2257
2294
2258 #else
2295 #else
2259 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2296 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2260 $ hg log -Gfr 'desc("mFGm-0")' d
2297 $ hg log -Gfr 'desc("mFGm-0")' d
2261 o g-1: update d
2298 o g-1: update d
2262 |
2299 |
2263 o i-2: c -move-> d, s -move-> t
2300 o i-2: c -move-> d, s -move-> t
2264 |
2301 |
2265 ~
2302 ~
2266 #endif
2303 #endif
2267
2304
2268 #if no-changeset
2305 #if no-changeset
2269 $ hg log -Gfr 'desc("mGFm-0")' d
2306 $ hg log -Gfr 'desc("mGFm-0")' d
2270 o mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
2307 o mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
2271 |\
2308 |\
2272 | o g-1: update d
2309 | o g-1: update d
2273 | |
2310 | |
2274 o | f-2: rename i -> d
2311 o | f-2: rename i -> d
2275 | |
2312 | |
2276 o | f-1: rename h -> i
2313 o | f-1: rename h -> i
2277 |/
2314 |/
2278 o i-2: c -move-> d, s -move-> t
2315 o i-2: c -move-> d, s -move-> t
2279 |
2316 |
2280 o i-1: a -move-> c, p -move-> s
2317 o i-1: a -move-> c, p -move-> s
2281 |
2318 |
2282 o i-0 initial commit: a b h
2319 o i-0 initial commit: a b h
2283
2320
2284 #else
2321 #else
2285 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2322 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2286 $ hg log -Gfr 'desc("mGFm-0")' d
2323 $ hg log -Gfr 'desc("mGFm-0")' d
2287 o g-1: update d
2324 o g-1: update d
2288 |
2325 |
2289 o i-2: c -move-> d, s -move-> t
2326 o i-2: c -move-> d, s -move-> t
2290 |
2327 |
2291 ~
2328 ~
2292 #endif
2329 #endif
2293
2330
2294
2331
2295 Comparing with merging with a deletion (and keeping the file)
2332 Comparing with merging with a deletion (and keeping the file)
2296 -------------------------------------------------------------
2333 -------------------------------------------------------------
2297
2334
2298 Merge:
2335 Merge:
2299 - one removing a file (d)
2336 - one removing a file (d)
2300 - one updating that file
2337 - one updating that file
2301 - the merge keep the modified version of the file (canceling the delete)
2338 - the merge keep the modified version of the file (canceling the delete)
2302
2339
2303 In this case, the file keep on living after the merge. So we should not drop its
2340 In this case, the file keep on living after the merge. So we should not drop its
2304 copy tracing chain.
2341 copy tracing chain.
2305
2342
2306 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
2343 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
2307 o mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
2344 o mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
2308 |\
2345 |\
2309 +---o mCGm-0 merge updated/deleted - revive the file (updated content) - one way
2346 +---o mCGm-0 merge updated/deleted - revive the file (updated content) - one way
2310 | |/
2347 | |/
2311 | o g-1: update d
2348 | o g-1: update d
2312 | |
2349 | |
2313 o | c-1 delete d
2350 o | c-1 delete d
2314 |/
2351 |/
2315 o i-2: c -move-> d, s -move-> t
2352 o i-2: c -move-> d, s -move-> t
2316 |
2353 |
2317 o i-1: a -move-> c, p -move-> s
2354 o i-1: a -move-> c, p -move-> s
2318 |
2355 |
2319 o i-0 initial commit: a b h
2356 o i-0 initial commit: a b h
2320
2357
2321
2358
2322 'a' is the copy source of 'd'
2359 'a' is the copy source of 'd'
2323
2360
2324 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")'
2361 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")'
2325 A d
2362 A d
2326 a (no-compatibility no-changeset !)
2363 a (no-compatibility no-changeset !)
2327 A t
2364 A t
2328 p
2365 p
2329 R a
2366 R a
2330 R p
2367 R p
2331 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")'
2368 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")'
2332 A d
2369 A d
2333 a (no-compatibility no-changeset !)
2370 a (no-compatibility no-changeset !)
2334 A t
2371 A t
2335 p
2372 p
2336 R a
2373 R a
2337 R p
2374 R p
2338 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")'
2375 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")'
2339 A d
2376 A d
2340 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")'
2377 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")'
2341 A d
2378 A d
2342 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")'
2379 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")'
2343 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")'
2380 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")'
2344
2381
2345
2382
2346 Comparing with merge restoring an untouched deleted file
2383 Comparing with merge restoring an untouched deleted file
2347 --------------------------------------------------------
2384 --------------------------------------------------------
2348
2385
2349 Merge:
2386 Merge:
2350 - one removing a file (d)
2387 - one removing a file (d)
2351 - one leaving the file untouched
2388 - one leaving the file untouched
2352 - the merge actively restore the file to the same content.
2389 - the merge actively restore the file to the same content.
2353
2390
2354 In this case, the file keep on living after the merge. So we should not drop its
2391 In this case, the file keep on living after the merge. So we should not drop its
2355 copy tracing chain.
2392 copy tracing chain.
2356
2393
2357 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
2394 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
2358 o mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
2395 o mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
2359 |\
2396 |\
2360 +---o mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
2397 +---o mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
2361 | |/
2398 | |/
2362 | o c-1 delete d
2399 | o c-1 delete d
2363 | |
2400 | |
2364 o | b-1: b update
2401 o | b-1: b update
2365 |/
2402 |/
2366 o i-2: c -move-> d, s -move-> t
2403 o i-2: c -move-> d, s -move-> t
2367 |
2404 |
2368 o i-1: a -move-> c, p -move-> s
2405 o i-1: a -move-> c, p -move-> s
2369 |
2406 |
2370 o i-0 initial commit: a b h
2407 o i-0 initial commit: a b h
2371
2408
2372
2409
2373 'a' is the the copy source of 'd'
2410 'a' is the the copy source of 'd'
2374
2411
2375 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
2412 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
2376 M b
2413 M b
2377 A d
2414 A d
2378 a (no-compatibility no-changeset !)
2415 a (no-compatibility no-changeset !)
2379 A t
2416 A t
2380 p
2417 p
2381 R a
2418 R a
2382 R p
2419 R p
2383 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
2420 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
2384 M b
2421 M b
2385 A d
2422 A d
2386 a (no-compatibility no-changeset !)
2423 a (no-compatibility no-changeset !)
2387 A t
2424 A t
2388 p
2425 p
2389 R a
2426 R a
2390 R p
2427 R p
2391 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")'
2428 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")'
2392 M b
2429 M b
2393 A d
2430 A d
2394 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")'
2431 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")'
2395 M b
2432 M b
2396 A d
2433 A d
2397 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")'
2434 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")'
2398 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")'
2435 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")'
2399
2436
2400
2437
2401 Merging a branch where a rename was deleted with a branch where the same file was renamed
2438 Merging a branch where a rename was deleted with a branch where the same file was renamed
2402 ------------------------------------------------------------------------------------------
2439 ------------------------------------------------------------------------------------------
2403
2440
2404 Create a "conflicting" merge where `d` get removed on one branch before its
2441 Create a "conflicting" merge where `d` get removed on one branch before its
2405 rename information actually conflict with the other branch.
2442 rename information actually conflict with the other branch.
2406
2443
2407 (the copy information from the branch that was not deleted should win).
2444 (the copy information from the branch that was not deleted should win).
2408
2445
2409 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
2446 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
2410 o mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
2447 o mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
2411 |\
2448 |\
2412 +---o mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
2449 +---o mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
2413 | |/
2450 | |/
2414 | o h-1: b -(move)-> d
2451 | o h-1: b -(move)-> d
2415 | |
2452 | |
2416 o | c-1 delete d
2453 o | c-1 delete d
2417 | |
2454 | |
2418 o | i-2: c -move-> d, s -move-> t
2455 o | i-2: c -move-> d, s -move-> t
2419 | |
2456 | |
2420 o | i-1: a -move-> c, p -move-> s
2457 o | i-1: a -move-> c, p -move-> s
2421 |/
2458 |/
2422 o i-0 initial commit: a b h
2459 o i-0 initial commit: a b h
2423
2460
2424
2461
2425 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCH-delete-before-conflict-m")'
2462 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCH-delete-before-conflict-m")'
2426 A d
2463 A d
2427 b (no-compatibility no-changeset !)
2464 b (no-compatibility no-changeset !)
2428 A t
2465 A t
2429 p
2466 p
2430 R a
2467 R a
2431 R b
2468 R b
2432 R p
2469 R p
2433 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mHC-delete-before-conflict-m")'
2470 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mHC-delete-before-conflict-m")'
2434 A d
2471 A d
2435 b
2472 b
2436 A t
2473 A t
2437 p
2474 p
2438 R a
2475 R a
2439 R b
2476 R b
2440 R p
2477 R p
2441 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCH-delete-before-conflict-m")'
2478 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCH-delete-before-conflict-m")'
2442 A d
2479 A d
2443 b
2480 b
2444 R b
2481 R b
2445 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mHC-delete-before-conflict-m")'
2482 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mHC-delete-before-conflict-m")'
2446 A d
2483 A d
2447 b
2484 b
2448 R b
2485 R b
2449 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mCH-delete-before-conflict-m")'
2486 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mCH-delete-before-conflict-m")'
2450 A t
2487 A t
2451 p
2488 p
2452 R a
2489 R a
2453 R p
2490 R p
2454 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")'
2491 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")'
2455 A t
2492 A t
2456 p
2493 p
2457 R a
2494 R a
2458 R p
2495 R p
2459
2496
2460 Variant of previous with extra changes introduced by the merge
2497 Variant of previous with extra changes introduced by the merge
2461 --------------------------------------------------------------
2498 --------------------------------------------------------------
2462
2499
2463 (see case declaration for details)
2500 (see case declaration for details)
2464
2501
2465 Subcase: merge has same initial content on both side, but merge introduced a change
2502 Subcase: merge has same initial content on both side, but merge introduced a change
2466 ```````````````````````````````````````````````````````````````````````````````````
2503 ```````````````````````````````````````````````````````````````````````````````````
2467
2504
2468 - the "e-" branch renaming b to f (through 'g')
2505 - the "e-" branch renaming b to f (through 'g')
2469 - the "a-" branch renaming d to f (through e)
2506 - the "a-" branch renaming d to f (through e)
2470 - the merge add new change to b
2507 - the merge add new change to b
2471
2508
2472 $ hg log -G --rev '::(desc("mAE-change-m")+desc("mEA-change-m"))'
2509 $ hg log -G --rev '::(desc("mAE-change-m")+desc("mEA-change-m"))'
2473 o mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
2510 o mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
2474 |\
2511 |\
2475 +---o mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
2512 +---o mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
2476 | |/
2513 | |/
2477 | o e-2 g -move-> f
2514 | o e-2 g -move-> f
2478 | |
2515 | |
2479 | o e-1 b -move-> g
2516 | o e-1 b -move-> g
2480 | |
2517 | |
2481 o | a-2: e -move-> f
2518 o | a-2: e -move-> f
2482 | |
2519 | |
2483 o | a-1: d -move-> e
2520 o | a-1: d -move-> e
2484 |/
2521 |/
2485 o i-2: c -move-> d, s -move-> t
2522 o i-2: c -move-> d, s -move-> t
2486 |
2523 |
2487 o i-1: a -move-> c, p -move-> s
2524 o i-1: a -move-> c, p -move-> s
2488 |
2525 |
2489 o i-0 initial commit: a b h
2526 o i-0 initial commit: a b h
2490
2527
2491 #if no-changeset
2528 #if no-changeset
2492 $ hg manifest --debug --rev 'desc("mAE-change-m-0")' | grep '644 f'
2529 $ hg manifest --debug --rev 'desc("mAE-change-m-0")' | grep '644 f'
2493 2f649fba7eb284e720d02b61f0546fcef694c045 644 f
2530 2f649fba7eb284e720d02b61f0546fcef694c045 644 f
2494 $ hg manifest --debug --rev 'desc("mEA-change-m-0")' | grep '644 f'
2531 $ hg manifest --debug --rev 'desc("mEA-change-m-0")' | grep '644 f'
2495 774e7c1637d536b99e2d8ef16fd731f87a82bd09 644 f
2532 774e7c1637d536b99e2d8ef16fd731f87a82bd09 644 f
2496 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
2533 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
2497 b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f
2534 b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f
2498 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
2535 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
2499 e8825b386367b29fec957283a80bb47b47483fe1 644 f
2536 e8825b386367b29fec957283a80bb47b47483fe1 644 f
2500 $ hg debugindex f | ../no-linkrev
2537 $ hg debugindex f | ../no-linkrev
2501 rev linkrev nodeid p1 p2
2538 rev linkrev nodeid p1 p2
2502 0 * b76eb76580df 000000000000 000000000000
2539 0 * b76eb76580df 000000000000 000000000000
2503 1 * e8825b386367 000000000000 000000000000
2540 1 * e8825b386367 000000000000 000000000000
2504 2 * 2ff93c643948 b76eb76580df e8825b386367
2541 2 * 2ff93c643948 b76eb76580df e8825b386367
2505 3 * 2f649fba7eb2 b76eb76580df e8825b386367
2542 3 * 2f649fba7eb2 b76eb76580df e8825b386367
2506 4 * 774e7c1637d5 e8825b386367 b76eb76580df
2543 4 * 774e7c1637d5 e8825b386367 b76eb76580df
2507 #else
2544 #else
2508 $ hg manifest --debug --rev 'desc("mAE-change-m-0")' | grep '644 f'
2545 $ hg manifest --debug --rev 'desc("mAE-change-m-0")' | grep '644 f'
2509 d3613c1ec8310a812ac4268fd853ac576b6caea5 644 f
2546 d3613c1ec8310a812ac4268fd853ac576b6caea5 644 f
2510 $ hg manifest --debug --rev 'desc("mEA-change-m-0")' | grep '644 f'
2547 $ hg manifest --debug --rev 'desc("mEA-change-m-0")' | grep '644 f'
2511 05e03c868bbcab4a649cb33a238d7aa07398a469 644 f
2548 05e03c868bbcab4a649cb33a238d7aa07398a469 644 f
2512 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
2549 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
2513 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
2550 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
2514 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
2551 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
2515 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
2552 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
2516 $ hg debugindex f | ../no-linkrev
2553 $ hg debugindex f | ../no-linkrev
2517 rev linkrev nodeid p1 p2
2554 rev linkrev nodeid p1 p2
2518 0 * ae258f702dfe 000000000000 000000000000
2555 0 * ae258f702dfe 000000000000 000000000000
2519 1 * d3613c1ec831 ae258f702dfe 000000000000
2556 1 * d3613c1ec831 ae258f702dfe 000000000000
2520 2 * 05e03c868bbc ae258f702dfe 000000000000
2557 2 * 05e03c868bbc ae258f702dfe 000000000000
2521 #endif
2558 #endif
2522
2559
2523 # Here the filelog based implementation is not looking at the rename
2560 # Here the filelog based implementation is not looking at the rename
2524 # information (because the file exist on both side). However the changelog
2561 # information (because the file exist on both side). However the changelog
2525 # based on works fine. We have different output.
2562 # based on works fine. We have different output.
2526
2563
2527 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAE-change-m-0")'
2564 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAE-change-m-0")'
2528 M f
2565 M f
2529 b (no-filelog !)
2566 b (no-filelog !)
2530 R b
2567 R b
2531 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEA-change-m-0")'
2568 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEA-change-m-0")'
2532 M f
2569 M f
2533 b (no-filelog !)
2570 b (no-filelog !)
2534 R b
2571 R b
2535 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAE-change-m-0")'
2572 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAE-change-m-0")'
2536 M f
2573 M f
2537 d (no-filelog !)
2574 d (no-filelog !)
2538 R d
2575 R d
2539 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEA-change-m-0")'
2576 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEA-change-m-0")'
2540 M f
2577 M f
2541 d (no-filelog !)
2578 d (no-filelog !)
2542 R d
2579 R d
2543 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
2580 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
2544 A f
2581 A f
2545 d
2582 d
2546 R d
2583 R d
2547 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
2584 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
2548 A f
2585 A f
2549 b
2586 b
2550 R b
2587 R b
2551
2588
2552 # From here, we run status against revision where both source file exists.
2589 # From here, we run status against revision where both source file exists.
2553 #
2590 #
2554 # The filelog based implementation picks an arbitrary side based on revision
2591 # The filelog based implementation picks an arbitrary side based on revision
2555 # numbers. So the same side "wins" whatever the parents order is. This is
2592 # numbers. So the same side "wins" whatever the parents order is. This is
2556 # sub-optimal because depending on revision numbers means the result can be
2593 # sub-optimal because depending on revision numbers means the result can be
2557 # different from one repository to the next.
2594 # different from one repository to the next.
2558 #
2595 #
2559 # The changeset based algorithm use the parent order to break tie on conflicting
2596 # The changeset based algorithm use the parent order to break tie on conflicting
2560 # information and will have a different order depending on who is p1 and p2.
2597 # information and will have a different order depending on who is p1 and p2.
2561 # That order is stable accross repositories. (data from p1 prevails)
2598 # That order is stable accross repositories. (data from p1 prevails)
2562
2599
2563 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAE-change-m-0")'
2600 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAE-change-m-0")'
2564 A f
2601 A f
2565 d
2602 d
2566 R b
2603 R b
2567 R d
2604 R d
2568 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEA-change-m-0")'
2605 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEA-change-m-0")'
2569 A f
2606 A f
2570 d (filelog !)
2607 d (filelog !)
2571 b (no-filelog !)
2608 b (no-filelog !)
2572 R b
2609 R b
2573 R d
2610 R d
2574 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE-change-m-0")'
2611 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE-change-m-0")'
2575 A f
2612 A f
2576 a
2613 a
2577 A t
2614 A t
2578 p
2615 p
2579 R a
2616 R a
2580 R b
2617 R b
2581 R p
2618 R p
2582 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA-change-m-0")'
2619 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA-change-m-0")'
2583 A f
2620 A f
2584 a (filelog !)
2621 a (filelog !)
2585 b (no-filelog !)
2622 b (no-filelog !)
2586 A t
2623 A t
2587 p
2624 p
2588 R a
2625 R a
2589 R b
2626 R b
2590 R p
2627 R p
2591
2628
2592
2629
2593 Decision from previous merge are properly chained with later merge
2630 Decision from previous merge are properly chained with later merge
2594 ------------------------------------------------------------------
2631 ------------------------------------------------------------------
2595
2632
2596
2633
2597 Subcase: chaining conflicting rename resolution
2634 Subcase: chaining conflicting rename resolution
2598 ```````````````````````````````````````````````
2635 ```````````````````````````````````````````````
2599
2636
2600 The "mAEm" and "mEAm" case create a rename tracking conflict on file 'f'. We
2637 The "mAEm" and "mEAm" case create a rename tracking conflict on file 'f'. We
2601 add more change on the respective branch and merge again. These second merge
2638 add more change on the respective branch and merge again. These second merge
2602 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
2639 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
2603 about that file should stay unchanged.
2640 about that file should stay unchanged.
2604
2641
2605 The result from mAEm is the same for the subsequent merge:
2642 The result from mAEm is the same for the subsequent merge:
2606
2643
2607 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm")' f
2644 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm")' f
2608 A f
2645 A f
2609 a (filelog !)
2646 a (filelog !)
2610 a (sidedata !)
2647 a (sidedata !)
2611 a (upgraded !)
2648 a (upgraded !)
2612
2649
2613 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE,Km")' f
2650 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE,Km")' f
2614 A f
2651 A f
2615 a (filelog !)
2652 a (filelog !)
2616 a (sidedata !)
2653 a (sidedata !)
2617 a (upgraded !)
2654 a (upgraded !)
2618
2655
2619 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mK,AEm")' f
2656 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mK,AEm")' f
2620 A f
2657 A f
2621 a (filelog !)
2658 a (filelog !)
2622 a (missing-correct-output sidedata !)
2659 a (missing-correct-output sidedata !)
2623 a (missing-correct-output upgraded !)
2660 a (missing-correct-output upgraded !)
2624 b (known-bad-output sidedata !)
2661 b (known-bad-output sidedata !)
2625 b (known-bad-output upgraded !)
2662 b (known-bad-output upgraded !)
2626
2663
2627
2664
2628 The result from mEAm is the same for the subsequent merge:
2665 The result from mEAm is the same for the subsequent merge:
2629
2666
2630 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm")' f
2667 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm")' f
2631 A f
2668 A f
2632 a (filelog !)
2669 a (filelog !)
2633 b (sidedata !)
2670 b (sidedata !)
2634 b (upgraded !)
2671 b (upgraded !)
2635
2672
2636 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA,Jm")' f
2673 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA,Jm")' f
2637 A f
2674 A f
2638 a (filelog !)
2675 a (filelog !)
2639 b (sidedata !)
2676 b (sidedata !)
2640 b (upgraded !)
2677 b (upgraded !)
2641
2678
2642 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mJ,EAm")' f
2679 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mJ,EAm")' f
2643 A f
2680 A f
2644 a (filelog !)
2681 a (filelog !)
2645 b (missing-correct-output sidedata !)
2682 b (missing-correct-output sidedata !)
2646 b (missing-correct-output upgraded !)
2683 b (missing-correct-output upgraded !)
2647 a (known-bad-output sidedata !)
2684 a (known-bad-output sidedata !)
2648 a (known-bad-output upgraded !)
2685 a (known-bad-output upgraded !)
2649
2686
2650
2687
2651 Subcase: chaining salvage information during a merge
2688 Subcase: chaining salvage information during a merge
2652 ````````````````````````````````````````````````````
2689 ````````````````````````````````````````````````````
2653
2690
2654 We add more change on the branch were the file was deleted. merging again
2691 We add more change on the branch were the file was deleted. merging again
2655 should preserve the fact eh file was salvaged.
2692 should preserve the fact eh file was salvaged.
2656
2693
2657 reference output:
2694 reference output:
2658
2695
2659 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
2696 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
2660 M b
2697 M b
2661 A d
2698 A d
2662 a (filelog !)
2699 a (filelog !)
2663 a (sidedata !)
2700 a (sidedata !)
2664 a (upgraded !)
2701 a (upgraded !)
2665 A t
2702 A t
2666 p
2703 p
2667 R a
2704 R a
2668 R p
2705 R p
2669 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
2706 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
2670 M b
2707 M b
2671 A d
2708 A d
2672 a (filelog !)
2709 a (filelog !)
2673 a (sidedata !)
2710 a (sidedata !)
2674 a (upgraded !)
2711 a (upgraded !)
2675 A t
2712 A t
2676 p
2713 p
2677 R a
2714 R a
2678 R p
2715 R p
2679
2716
2680 chained output
2717 chained output
2681
2718
2682 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC+revert,Lm")'
2719 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC+revert,Lm")'
2683 M b
2720 M b
2684 A d
2721 A d
2685 a (filelog !)
2722 a (filelog !)
2686 a (missing-correct-output sidedata !)
2723 a (missing-correct-output sidedata !)
2687 a (missing-correct-output upgraded !)
2724 a (missing-correct-output upgraded !)
2688 A t
2725 A t
2689 p
2726 p
2690 A unrelated-l
2727 A unrelated-l
2691 R a
2728 R a
2692 R p
2729 R p
2693 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB+revert,Lm")'
2730 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB+revert,Lm")'
2694 M b
2731 M b
2695 A d
2732 A d
2696 a (filelog !)
2733 a (filelog !)
2697 a (missing-correct-output sidedata !)
2734 a (missing-correct-output sidedata !)
2698 a (missing-correct-output upgraded !)
2735 a (missing-correct-output upgraded !)
2699 A t
2736 A t
2700 p
2737 p
2701 A unrelated-l
2738 A unrelated-l
2702 R a
2739 R a
2703 R p
2740 R p
2704 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mL,BC+revertm")'
2741 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mL,BC+revertm")'
2705 M b
2742 M b
2706 A d
2743 A d
2707 a (filelog !)
2744 a (filelog !)
2708 a (missing-correct-output sidedata !)
2745 a (missing-correct-output sidedata !)
2709 a (missing-correct-output upgraded !)
2746 a (missing-correct-output upgraded !)
2710 A t
2747 A t
2711 p
2748 p
2712 A unrelated-l
2749 A unrelated-l
2713 R a
2750 R a
2714 R p
2751 R p
2715 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mL,CB+revertm")'
2752 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mL,CB+revertm")'
2716 M b
2753 M b
2717 A d
2754 A d
2718 a (filelog !)
2755 a (filelog !)
2719 a (missing-correct-output sidedata !)
2756 a (missing-correct-output sidedata !)
2720 a (missing-correct-output upgraded !)
2757 a (missing-correct-output upgraded !)
2721 A t
2758 A t
2722 p
2759 p
2723 A unrelated-l
2760 A unrelated-l
2724 R a
2761 R a
2725 R p
2762 R p
2726
2763
2727 Subcase: chaining "merged" information during a merge
2764 Subcase: chaining "merged" information during a merge
2728 ``````````````````````````````````````````````````````
2765 ``````````````````````````````````````````````````````
2729
2766
2730 When a non-rename change are merged with a copy overwrite, the merge pick the copy source from (p1) as the reference. We should preserve this information in subsequent merges.
2767 When a non-rename change are merged with a copy overwrite, the merge pick the copy source from (p1) as the reference. We should preserve this information in subsequent merges.
2731
2768
2732
2769
2733 reference output:
2770 reference output:
2734
2771
2735 (for details about the filelog pick, check the mFGm/mGFm case)
2772 (for details about the filelog pick, check the mFGm/mGFm case)
2736
2773
2737 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm")' d
2774 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm")' d
2738 A d
2775 A d
2739 a (filelog !)
2776 a (filelog !)
2740 h (sidedata !)
2777 h (sidedata !)
2741 h (upgraded !)
2778 h (upgraded !)
2742 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm")' d
2779 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm")' d
2743 A d
2780 A d
2744 a (filelog !)
2781 a (filelog !)
2745 a (sidedata !)
2782 a (sidedata !)
2746 a (upgraded !)
2783 a (upgraded !)
2747
2784
2748 Chained output
2785 Chained output
2749
2786
2750 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mO,FGm")' d
2787 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mO,FGm")' d
2751 A d
2788 A d
2752 a (filelog !)
2789 a (filelog !)
2753 h (sidedata !)
2790 h (sidedata !)
2754 h (upgraded !)
2791 h (upgraded !)
2755 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFG,Om")' d
2792 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFG,Om")' d
2756 A d
2793 A d
2757 a (filelog !)
2794 a (filelog !)
2758 h (sidedata !)
2795 h (sidedata !)
2759 h (upgraded !)
2796 h (upgraded !)
2760
2797
2761
2798
2762 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGF,Nm")' d
2799 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGF,Nm")' d
2763 A d
2800 A d
2764 a (filelog !)
2801 a (filelog !)
2765 a (missing-correct-output sidedata !)
2802 a (missing-correct-output sidedata !)
2766 a (missing-correct-output upgraded !)
2803 a (missing-correct-output upgraded !)
2767 h (known-bad-output sidedata !)
2804 h (known-bad-output sidedata !)
2768 h (known-bad-output upgraded !)
2805 h (known-bad-output upgraded !)
2769 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mN,GFm")' d
2806 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mN,GFm")' d
2770 A d
2807 A d
2771 a (filelog !)
2808 a (filelog !)
2772 a (missing-correct-output sidedata !)
2809 a (missing-correct-output sidedata !)
2773 a (missing-correct-output upgraded !)
2810 a (missing-correct-output upgraded !)
2774 h (known-bad-output sidedata !)
2811 h (known-bad-output sidedata !)
2775 h (known-bad-output upgraded !)
2812 h (known-bad-output upgraded !)
2776
2813
2777
2814
2778 Subcase: chaining conflicting rename resolution, with extra change during the merge
2815 Subcase: chaining conflicting rename resolution, with extra change during the merge
2779 ```````````````````````````````````````````````````````````````````````````````````
2816 ```````````````````````````````````````````````````````````````````````````````````
2780
2817
2781 The "mAEm" and "mEAm" case create a rename tracking conflict on file 'f'. We
2818 The "mAEm" and "mEAm" case create a rename tracking conflict on file 'f'. We
2782 add more change on the respective branch and merge again. These second merge
2819 add more change on the respective branch and merge again. These second merge
2783 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
2820 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
2784 about that file should stay unchanged.
2821 about that file should stay unchanged.
2785
2822
2786 The result from mAEm is the same for the subsequent merge:
2823 The result from mAEm is the same for the subsequent merge:
2787
2824
2788 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE-change-m")' f
2825 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE-change-m")' f
2789 A f
2826 A f
2790 a (filelog !)
2827 a (filelog !)
2791 a (sidedata !)
2828 a (sidedata !)
2792 a (upgraded !)
2829 a (upgraded !)
2793
2830
2794 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE-change,Km")' f
2831 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE-change,Km")' f
2795 A f
2832 A f
2796 a (filelog !)
2833 a (filelog !)
2797 a (sidedata !)
2834 a (sidedata !)
2798 a (upgraded !)
2835 a (upgraded !)
2799
2836
2800 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mK,AE-change-m")' f
2837 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mK,AE-change-m")' f
2801 A f
2838 A f
2802 a (filelog !)
2839 a (filelog !)
2803 a (missing-correct-output sidedata !)
2840 a (missing-correct-output sidedata !)
2804 a (missing-correct-output upgraded !)
2841 a (missing-correct-output upgraded !)
2805 b (known-bad-output sidedata !)
2842 b (known-bad-output sidedata !)
2806 b (known-bad-output upgraded !)
2843 b (known-bad-output upgraded !)
2807
2844
2808
2845
2809 The result from mEAm is the same for the subsequent merge:
2846 The result from mEAm is the same for the subsequent merge:
2810
2847
2811 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA-change-m")' f
2848 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA-change-m")' f
2812 A f
2849 A f
2813 a (filelog !)
2850 a (filelog !)
2814 b (sidedata !)
2851 b (sidedata !)
2815 b (upgraded !)
2852 b (upgraded !)
2816
2853
2817 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA-change,Jm")' f
2854 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA-change,Jm")' f
2818 A f
2855 A f
2819 a (filelog !)
2856 a (filelog !)
2820 b (sidedata !)
2857 b (sidedata !)
2821 b (upgraded !)
2858 b (upgraded !)
2822
2859
2823 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mJ,EA-change-m")' f
2860 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mJ,EA-change-m")' f
2824 A f
2861 A f
2825 a (filelog !)
2862 a (filelog !)
2826 b (missing-correct-output sidedata !)
2863 b (missing-correct-output sidedata !)
2827 b (missing-correct-output upgraded !)
2864 b (missing-correct-output upgraded !)
2828 a (known-bad-output sidedata !)
2865 a (known-bad-output sidedata !)
2829 a (known-bad-output upgraded !)
2866 a (known-bad-output upgraded !)
General Comments 0
You need to be logged in to leave comments. Login now