##// END OF EJS Templates
test-copies: improve description of the A+B case...
marmoute -
r47283:e2097720 default
parent child Browse files
Show More
@@ -1,1777 +1,1777 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 >> $HGRCPATH
17 $ cat << EOF >> $HGRCPATH
18 > [diff]
18 > [diff]
19 > git=yes
19 > git=yes
20 > [command-templates]
20 > [command-templates]
21 > log={rev} {desc}\n
21 > log={rev} {desc}\n
22 > EOF
22 > EOF
23
23
24 #if compatibility
24 #if compatibility
25 $ cat >> $HGRCPATH << EOF
25 $ cat >> $HGRCPATH << EOF
26 > [experimental]
26 > [experimental]
27 > copies.read-from = compatibility
27 > copies.read-from = compatibility
28 > EOF
28 > EOF
29 #endif
29 #endif
30
30
31 #if changeset
31 #if changeset
32 $ cat >> $HGRCPATH << EOF
32 $ cat >> $HGRCPATH << EOF
33 > [experimental]
33 > [experimental]
34 > copies.read-from = changeset-only
34 > copies.read-from = changeset-only
35 > copies.write-to = changeset-only
35 > copies.write-to = changeset-only
36 > EOF
36 > EOF
37 #endif
37 #endif
38
38
39 #if sidedata
39 #if sidedata
40 $ cat >> $HGRCPATH << EOF
40 $ cat >> $HGRCPATH << EOF
41 > [format]
41 > [format]
42 > exp-use-side-data = yes
42 > exp-use-side-data = yes
43 > exp-use-copies-side-data-changeset = yes
43 > exp-use-copies-side-data-changeset = yes
44 > EOF
44 > EOF
45 #endif
45 #endif
46
46
47
47
48 $ cat > same-content.txt << EOF
48 $ cat > same-content.txt << EOF
49 > Here is some content that will be the same accros multiple file.
49 > Here is some content that will be the same accros multiple file.
50 >
50 >
51 > This is done on purpose so that we end up in some merge situation, were the
51 > This is done on purpose so that we end up in some merge situation, were the
52 > resulting content is the same as in the parent(s), but a new filenodes still
52 > resulting content is the same as in the parent(s), but a new filenodes still
53 > need to be created to record some file history information (especially
53 > need to be created to record some file history information (especially
54 > about copies).
54 > about copies).
55 > EOF
55 > EOF
56
56
57 $ hg init repo-chain
57 $ hg init repo-chain
58 $ cd repo-chain
58 $ cd repo-chain
59
59
60 Add some linear rename initialy
60 Add some linear rename initialy
61
61
62 $ cp ../same-content.txt a
62 $ cp ../same-content.txt a
63 $ cp ../same-content.txt b
63 $ cp ../same-content.txt b
64 $ cp ../same-content.txt h
64 $ cp ../same-content.txt h
65 $ hg ci -Am 'i-0 initial commit: a b h'
65 $ hg ci -Am 'i-0 initial commit: a b h'
66 adding a
66 adding a
67 adding b
67 adding b
68 adding h
68 adding h
69 $ hg mv a c
69 $ hg mv a c
70 $ hg ci -Am 'i-1: a -move-> c'
70 $ hg ci -Am 'i-1: a -move-> c'
71 $ hg mv c d
71 $ hg mv c d
72 $ hg ci -Am 'i-2: c -move-> d'
72 $ hg ci -Am 'i-2: c -move-> d'
73 $ hg log -G
73 $ hg log -G
74 @ 2 i-2: c -move-> d
74 @ 2 i-2: c -move-> d
75 |
75 |
76 o 1 i-1: a -move-> c
76 o 1 i-1: a -move-> c
77 |
77 |
78 o 0 i-0 initial commit: a b h
78 o 0 i-0 initial commit: a b h
79
79
80
80
81 And having another branch with renames on the other side
81 And having another branch with renames on the other side
82
82
83 $ hg mv d e
83 $ hg mv d e
84 $ hg ci -Am 'a-1: d -move-> e'
84 $ hg ci -Am 'a-1: d -move-> e'
85 $ hg mv e f
85 $ hg mv e f
86 $ hg ci -Am 'a-2: e -move-> f'
86 $ hg ci -Am 'a-2: e -move-> f'
87 $ hg log -G --rev '::.'
87 $ hg log -G --rev '::.'
88 @ 4 a-2: e -move-> f
88 @ 4 a-2: e -move-> f
89 |
89 |
90 o 3 a-1: d -move-> e
90 o 3 a-1: d -move-> e
91 |
91 |
92 o 2 i-2: c -move-> d
92 o 2 i-2: c -move-> d
93 |
93 |
94 o 1 i-1: a -move-> c
94 o 1 i-1: a -move-> c
95 |
95 |
96 o 0 i-0 initial commit: a b h
96 o 0 i-0 initial commit: a b h
97
97
98
98
99 Have a branching with nothing on one side
99 Have a branching with nothing on one side
100
100
101 $ hg up 'desc("i-2")'
101 $ hg up 'desc("i-2")'
102 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
102 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
103 $ echo foo > b
103 $ echo foo > b
104 $ hg ci -m 'b-1: b update'
104 $ hg ci -m 'b-1: b update'
105 created new head
105 created new head
106 $ hg log -G --rev '::.'
106 $ hg log -G --rev '::.'
107 @ 5 b-1: b update
107 @ 5 b-1: b update
108 |
108 |
109 o 2 i-2: c -move-> d
109 o 2 i-2: c -move-> d
110 |
110 |
111 o 1 i-1: a -move-> c
111 o 1 i-1: a -move-> c
112 |
112 |
113 o 0 i-0 initial commit: a b h
113 o 0 i-0 initial commit: a b h
114
114
115
115
116 Create a branch that delete a file previous renamed
116 Create a branch that delete a file previous renamed
117
117
118 $ hg up 'desc("i-2")'
118 $ hg up 'desc("i-2")'
119 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
120 $ hg rm d
120 $ hg rm d
121 $ hg ci -m 'c-1 delete d'
121 $ hg ci -m 'c-1 delete d'
122 created new head
122 created new head
123 $ hg log -G --rev '::.'
123 $ hg log -G --rev '::.'
124 @ 6 c-1 delete d
124 @ 6 c-1 delete d
125 |
125 |
126 o 2 i-2: c -move-> d
126 o 2 i-2: c -move-> d
127 |
127 |
128 o 1 i-1: a -move-> c
128 o 1 i-1: a -move-> c
129 |
129 |
130 o 0 i-0 initial commit: a b h
130 o 0 i-0 initial commit: a b h
131
131
132
132
133 Create a branch that delete a file previous renamed and recreate it
133 Create a branch that delete a file previous renamed and recreate it
134
134
135 $ hg up 'desc("i-2")'
135 $ hg up 'desc("i-2")'
136 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
136 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 $ hg rm d
137 $ hg rm d
138 $ hg ci -m 'd-1 delete d'
138 $ hg ci -m 'd-1 delete d'
139 created new head
139 created new head
140 $ echo bar > d
140 $ echo bar > d
141 $ hg add d
141 $ hg add d
142 $ hg ci -m 'd-2 re-add d'
142 $ hg ci -m 'd-2 re-add d'
143 $ hg log -G --rev '::.'
143 $ hg log -G --rev '::.'
144 @ 8 d-2 re-add d
144 @ 8 d-2 re-add d
145 |
145 |
146 o 7 d-1 delete d
146 o 7 d-1 delete d
147 |
147 |
148 o 2 i-2: c -move-> d
148 o 2 i-2: c -move-> d
149 |
149 |
150 o 1 i-1: a -move-> c
150 o 1 i-1: a -move-> c
151 |
151 |
152 o 0 i-0 initial commit: a b h
152 o 0 i-0 initial commit: a b h
153
153
154
154
155 Having another branch renaming a different file to the same filename as another
155 Having another branch renaming a different file to the same filename as another
156
156
157 $ hg up 'desc("i-2")'
157 $ hg up 'desc("i-2")'
158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 $ hg mv b g
159 $ hg mv b g
160 $ hg ci -m 'e-1 b -move-> g'
160 $ hg ci -m 'e-1 b -move-> g'
161 created new head
161 created new head
162 $ hg mv g f
162 $ hg mv g f
163 $ hg ci -m 'e-2 g -move-> f'
163 $ hg ci -m 'e-2 g -move-> f'
164 $ hg log -G --rev '::.'
164 $ hg log -G --rev '::.'
165 @ 10 e-2 g -move-> f
165 @ 10 e-2 g -move-> f
166 |
166 |
167 o 9 e-1 b -move-> g
167 o 9 e-1 b -move-> g
168 |
168 |
169 o 2 i-2: c -move-> d
169 o 2 i-2: c -move-> d
170 |
170 |
171 o 1 i-1: a -move-> c
171 o 1 i-1: a -move-> c
172 |
172 |
173 o 0 i-0 initial commit: a b h
173 o 0 i-0 initial commit: a b h
174
174
175
175
176 Setup all merge
176 Setup all merge
177 ===============
177 ===============
178
178
179 This is done beforehand to validate that the upgrade process creates valid copy
179 This is done beforehand to validate that the upgrade process creates valid copy
180 information.
180 information.
181
181
182 merging with unrelated change does not interfere with the renames
182 merging with unrelated change does not interfere with the renames
183 ---------------------------------------------------------------
183 ---------------------------------------------------------------
184
184
185 - rename on one side
185 - rename on one side
186 - unrelated change on the other side
186 - unrelated change on the other side
187
187
188 $ case_desc="simple merge"
188 $ case_desc="simple merge - A side: multiple renames, B side: unrelated update"
189
189
190 $ hg up 'desc("b-1")'
190 $ hg up 'desc("b-1")'
191 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
191 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
192 $ hg merge 'desc("a-2")'
192 $ hg merge 'desc("a-2")'
193 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
193 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
194 (branch merge, don't forget to commit)
194 (branch merge, don't forget to commit)
195 $ hg ci -m "mBAm-0 $case_desc - one way"
195 $ hg ci -m "mBAm-0 $case_desc - one way"
196 $ hg up 'desc("a-2")'
196 $ hg up 'desc("a-2")'
197 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
197 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
198 $ hg merge 'desc("b-1")'
198 $ hg merge 'desc("b-1")'
199 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
199 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
200 (branch merge, don't forget to commit)
200 (branch merge, don't forget to commit)
201 $ hg ci -m "mABm-0 $case_desc - the other way"
201 $ hg ci -m "mABm-0 $case_desc - the other way"
202 created new head
202 created new head
203 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
203 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
204 @ 12 mABm-0 simple merge - the other way
204 @ 12 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
205 |\
205 |\
206 +---o 11 mBAm-0 simple merge - one way
206 +---o 11 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
207 | |/
207 | |/
208 | o 5 b-1: b update
208 | o 5 b-1: b update
209 | |
209 | |
210 o | 4 a-2: e -move-> f
210 o | 4 a-2: e -move-> f
211 | |
211 | |
212 o | 3 a-1: d -move-> e
212 o | 3 a-1: d -move-> e
213 |/
213 |/
214 o 2 i-2: c -move-> d
214 o 2 i-2: c -move-> d
215 |
215 |
216 o 1 i-1: a -move-> c
216 o 1 i-1: a -move-> c
217 |
217 |
218 o 0 i-0 initial commit: a b h
218 o 0 i-0 initial commit: a b h
219
219
220
220
221
221
222 merging with the side having a delete
222 merging with the side having a delete
223 -------------------------------------
223 -------------------------------------
224
224
225 case summary:
225 case summary:
226 - one with change to an unrelated file
226 - one with change to an unrelated file
227 - one deleting the change
227 - one deleting the change
228 and recreate an unrelated file after the merge
228 and recreate an unrelated file after the merge
229
229
230 $ case_desc="simple merge"
230 $ case_desc="simple merge"
231
231
232 $ hg up 'desc("b-1")'
232 $ hg up 'desc("b-1")'
233 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
233 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
234 $ hg merge 'desc("c-1")'
234 $ hg merge 'desc("c-1")'
235 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
235 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
236 (branch merge, don't forget to commit)
236 (branch merge, don't forget to commit)
237 $ hg ci -m "mBCm-0 $case_desc - one way"
237 $ hg ci -m "mBCm-0 $case_desc - one way"
238 $ echo bar > d
238 $ echo bar > d
239 $ hg add d
239 $ hg add d
240 $ hg ci -m 'mBCm-1 re-add d'
240 $ hg ci -m 'mBCm-1 re-add d'
241 $ hg up 'desc("c-1")'
241 $ hg up 'desc("c-1")'
242 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
242 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
243 $ hg merge 'desc("b-1")'
243 $ hg merge 'desc("b-1")'
244 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
245 (branch merge, don't forget to commit)
245 (branch merge, don't forget to commit)
246 $ hg ci -m "mCBm-0 $case_desc - the other way"
246 $ hg ci -m "mCBm-0 $case_desc - the other way"
247 created new head
247 created new head
248 $ echo bar > d
248 $ echo bar > d
249 $ hg add d
249 $ hg add d
250 $ hg ci -m 'mCBm-1 re-add d'
250 $ hg ci -m 'mCBm-1 re-add d'
251 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
251 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
252 @ 16 mCBm-1 re-add d
252 @ 16 mCBm-1 re-add d
253 |
253 |
254 o 15 mCBm-0 simple merge - the other way
254 o 15 mCBm-0 simple merge - the other way
255 |\
255 |\
256 | | o 14 mBCm-1 re-add d
256 | | o 14 mBCm-1 re-add d
257 | | |
257 | | |
258 +---o 13 mBCm-0 simple merge - one way
258 +---o 13 mBCm-0 simple merge - one way
259 | |/
259 | |/
260 | o 6 c-1 delete d
260 | o 6 c-1 delete d
261 | |
261 | |
262 o | 5 b-1: b update
262 o | 5 b-1: b update
263 |/
263 |/
264 o 2 i-2: c -move-> d
264 o 2 i-2: c -move-> d
265 |
265 |
266 o 1 i-1: a -move-> c
266 o 1 i-1: a -move-> c
267 |
267 |
268 o 0 i-0 initial commit: a b h
268 o 0 i-0 initial commit: a b h
269
269
270
270
271 Comparing with a merge re-adding the file afterward
271 Comparing with a merge re-adding the file afterward
272 ---------------------------------------------------
272 ---------------------------------------------------
273
273
274 Merge:
274 Merge:
275 - one with change to an unrelated file
275 - one with change to an unrelated file
276 - one deleting and recreating the change
276 - one deleting and recreating the change
277
277
278 $ case_desc="simple merge"
278 $ case_desc="simple merge"
279
279
280 $ hg up 'desc("b-1")'
280 $ hg up 'desc("b-1")'
281 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
281 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
282 $ hg merge 'desc("d-2")'
282 $ hg merge 'desc("d-2")'
283 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
283 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 (branch merge, don't forget to commit)
284 (branch merge, don't forget to commit)
285 $ hg ci -m "mBDm-0 $case_desc - one way"
285 $ hg ci -m "mBDm-0 $case_desc - one way"
286 $ hg up 'desc("d-2")'
286 $ hg up 'desc("d-2")'
287 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 $ hg merge 'desc("b-1")'
288 $ hg merge 'desc("b-1")'
289 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
289 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
290 (branch merge, don't forget to commit)
290 (branch merge, don't forget to commit)
291 $ hg ci -m "mDBm-0 $case_desc - the other way"
291 $ hg ci -m "mDBm-0 $case_desc - the other way"
292 created new head
292 created new head
293 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
293 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
294 @ 18 mDBm-0 simple merge - the other way
294 @ 18 mDBm-0 simple merge - the other way
295 |\
295 |\
296 +---o 17 mBDm-0 simple merge - one way
296 +---o 17 mBDm-0 simple merge - one way
297 | |/
297 | |/
298 | o 8 d-2 re-add d
298 | o 8 d-2 re-add d
299 | |
299 | |
300 | o 7 d-1 delete d
300 | o 7 d-1 delete d
301 | |
301 | |
302 o | 5 b-1: b update
302 o | 5 b-1: b update
303 |/
303 |/
304 o 2 i-2: c -move-> d
304 o 2 i-2: c -move-> d
305 |
305 |
306 o 1 i-1: a -move-> c
306 o 1 i-1: a -move-> c
307 |
307 |
308 o 0 i-0 initial commit: a b h
308 o 0 i-0 initial commit: a b h
309
309
310
310
311
311
312 Comparing with a merge with colliding rename
312 Comparing with a merge with colliding rename
313 --------------------------------------------
313 --------------------------------------------
314
314
315 - the "e-" branch renaming b to f (through 'g')
315 - the "e-" branch renaming b to f (through 'g')
316 - the "a-" branch renaming d to f (through e)
316 - the "a-" branch renaming d to f (through e)
317
317
318 $ case_desc="simple merge"
318 $ case_desc="simple merge"
319
319
320 $ hg up 'desc("a-2")'
320 $ hg up 'desc("a-2")'
321 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
321 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
322 $ hg merge 'desc("e-2")'
322 $ hg merge 'desc("e-2")'
323 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
323 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
324 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
324 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
325 (branch merge, don't forget to commit)
325 (branch merge, don't forget to commit)
326 $ hg ci -m "mAEm-0 $case_desc - one way"
326 $ hg ci -m "mAEm-0 $case_desc - one way"
327 $ hg up 'desc("e-2")'
327 $ hg up 'desc("e-2")'
328 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
328 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
329 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
329 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
330 $ hg merge 'desc("a-2")'
330 $ hg merge 'desc("a-2")'
331 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
331 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
332 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
332 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
333 (branch merge, don't forget to commit)
333 (branch merge, don't forget to commit)
334 $ hg ci -m "mEAm-0 $case_desc - the other way"
334 $ hg ci -m "mEAm-0 $case_desc - the other way"
335 created new head
335 created new head
336 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
336 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
337 @ 20 mEAm-0 simple merge - the other way
337 @ 20 mEAm-0 simple merge - the other way
338 |\
338 |\
339 +---o 19 mAEm-0 simple merge - one way
339 +---o 19 mAEm-0 simple merge - one way
340 | |/
340 | |/
341 | o 10 e-2 g -move-> f
341 | o 10 e-2 g -move-> f
342 | |
342 | |
343 | o 9 e-1 b -move-> g
343 | o 9 e-1 b -move-> g
344 | |
344 | |
345 o | 4 a-2: e -move-> f
345 o | 4 a-2: e -move-> f
346 | |
346 | |
347 o | 3 a-1: d -move-> e
347 o | 3 a-1: d -move-> e
348 |/
348 |/
349 o 2 i-2: c -move-> d
349 o 2 i-2: c -move-> d
350 |
350 |
351 o 1 i-1: a -move-> c
351 o 1 i-1: a -move-> c
352 |
352 |
353 o 0 i-0 initial commit: a b h
353 o 0 i-0 initial commit: a b h
354
354
355
355
356
356
357 Merge:
357 Merge:
358 - one with change to an unrelated file (b)
358 - one with change to an unrelated file (b)
359 - one overwriting a file (d) with a rename (from h to i to d)
359 - one overwriting a file (d) with a rename (from h to i to d)
360
360
361 $ case_desc="simple merge"
361 $ case_desc="simple merge"
362
362
363 $ hg up 'desc("i-2")'
363 $ hg up 'desc("i-2")'
364 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
364 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
365 $ hg mv h i
365 $ hg mv h i
366 $ hg commit -m "f-1: rename h -> i"
366 $ hg commit -m "f-1: rename h -> i"
367 created new head
367 created new head
368 $ hg mv --force i d
368 $ hg mv --force i d
369 $ hg commit -m "f-2: rename i -> d"
369 $ hg commit -m "f-2: rename i -> d"
370 $ hg debugindex d
370 $ hg debugindex d
371 rev linkrev nodeid p1 p2
371 rev linkrev nodeid p1 p2
372 0 2 d8252ab2e760 000000000000 000000000000 (no-changeset !)
372 0 2 d8252ab2e760 000000000000 000000000000 (no-changeset !)
373 0 2 ae258f702dfe 000000000000 000000000000 (changeset !)
373 0 2 ae258f702dfe 000000000000 000000000000 (changeset !)
374 1 8 b004912a8510 000000000000 000000000000
374 1 8 b004912a8510 000000000000 000000000000
375 2 22 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
375 2 22 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
376 $ hg up 'desc("b-1")'
376 $ hg up 'desc("b-1")'
377 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
377 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
378 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
378 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
379 $ hg merge 'desc("f-2")'
379 $ hg merge 'desc("f-2")'
380 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
380 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
381 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
381 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
382 (branch merge, don't forget to commit)
382 (branch merge, don't forget to commit)
383 $ hg ci -m "mBFm-0 $case_desc - one way"
383 $ hg ci -m "mBFm-0 $case_desc - one way"
384 $ hg up 'desc("f-2")'
384 $ hg up 'desc("f-2")'
385 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
385 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
386 $ hg merge 'desc("b-1")'
386 $ hg merge 'desc("b-1")'
387 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
387 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
388 (branch merge, don't forget to commit)
388 (branch merge, don't forget to commit)
389 $ hg ci -m "mFBm-0 $case_desc - the other way"
389 $ hg ci -m "mFBm-0 $case_desc - the other way"
390 created new head
390 created new head
391 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
391 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
392 @ 24 mFBm-0 simple merge - the other way
392 @ 24 mFBm-0 simple merge - the other way
393 |\
393 |\
394 +---o 23 mBFm-0 simple merge - one way
394 +---o 23 mBFm-0 simple merge - one way
395 | |/
395 | |/
396 | o 22 f-2: rename i -> d
396 | o 22 f-2: rename i -> d
397 | |
397 | |
398 | o 21 f-1: rename h -> i
398 | o 21 f-1: rename h -> i
399 | |
399 | |
400 o | 5 b-1: b update
400 o | 5 b-1: b update
401 |/
401 |/
402 o 2 i-2: c -move-> d
402 o 2 i-2: c -move-> d
403 |
403 |
404 o 1 i-1: a -move-> c
404 o 1 i-1: a -move-> c
405 |
405 |
406 o 0 i-0 initial commit: a b h
406 o 0 i-0 initial commit: a b h
407
407
408
408
409
409
410 Merge:
410 Merge:
411 - one with change to a file
411 - one with change to a file
412 - one deleting and recreating the file
412 - one deleting and recreating the file
413
413
414 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
414 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
415 consider history and rename on both branch of the merge.
415 consider history and rename on both branch of the merge.
416
416
417 $ case_desc="simple merge"
417 $ case_desc="simple merge"
418
418
419 $ hg up 'desc("i-2")'
419 $ hg up 'desc("i-2")'
420 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
420 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
421 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
421 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
422 $ echo "some update" >> d
422 $ echo "some update" >> d
423 $ hg commit -m "g-1: update d"
423 $ hg commit -m "g-1: update d"
424 created new head
424 created new head
425 $ hg up 'desc("d-2")'
425 $ hg up 'desc("d-2")'
426 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
426 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
427 $ hg merge 'desc("g-1")' --tool :union
427 $ hg merge 'desc("g-1")' --tool :union
428 merging d
428 merging d
429 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
429 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
430 (branch merge, don't forget to commit)
430 (branch merge, don't forget to commit)
431 $ hg ci -m "mDGm-0 $case_desc - one way"
431 $ hg ci -m "mDGm-0 $case_desc - one way"
432 $ hg up 'desc("g-1")'
432 $ hg up 'desc("g-1")'
433 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
433 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
434 $ hg merge 'desc("d-2")' --tool :union
434 $ hg merge 'desc("d-2")' --tool :union
435 merging d
435 merging d
436 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
437 (branch merge, don't forget to commit)
437 (branch merge, don't forget to commit)
438 $ hg ci -m "mGDm-0 $case_desc - the other way"
438 $ hg ci -m "mGDm-0 $case_desc - the other way"
439 created new head
439 created new head
440 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
440 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
441 @ 27 mGDm-0 simple merge - the other way
441 @ 27 mGDm-0 simple merge - the other way
442 |\
442 |\
443 +---o 26 mDGm-0 simple merge - one way
443 +---o 26 mDGm-0 simple merge - one way
444 | |/
444 | |/
445 | o 25 g-1: update d
445 | o 25 g-1: update d
446 | |
446 | |
447 o | 8 d-2 re-add d
447 o | 8 d-2 re-add d
448 | |
448 | |
449 o | 7 d-1 delete d
449 o | 7 d-1 delete d
450 |/
450 |/
451 o 2 i-2: c -move-> d
451 o 2 i-2: c -move-> d
452 |
452 |
453 o 1 i-1: a -move-> c
453 o 1 i-1: a -move-> c
454 |
454 |
455 o 0 i-0 initial commit: a b h
455 o 0 i-0 initial commit: a b h
456
456
457
457
458
458
459 Merge:
459 Merge:
460 - one with change to a file (d)
460 - one with change to a file (d)
461 - one overwriting that file with a rename (from h to i, to d)
461 - one overwriting that file with a rename (from h to i, to d)
462
462
463 This case is similar to BF/FB, but an actual merge happens, so both side of the
463 This case is similar to BF/FB, but an actual merge happens, so both side of the
464 history are relevant.
464 history are relevant.
465
465
466 Note:
466 Note:
467 | In this case, the merge get conflicting information since on one side we have
467 | In this case, the merge get conflicting information since on one side we have
468 | "a -> c -> d". and one the other one we have "h -> i -> d".
468 | "a -> c -> d". and one the other one we have "h -> i -> d".
469 |
469 |
470 | The current code arbitrarily pick one side
470 | The current code arbitrarily pick one side
471
471
472 $ case_desc="simple merge"
472 $ case_desc="simple merge"
473
473
474 $ hg up 'desc("f-2")'
474 $ hg up 'desc("f-2")'
475 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
475 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
476 $ hg merge 'desc("g-1")' --tool :union
476 $ hg merge 'desc("g-1")' --tool :union
477 merging d (no-changeset !)
477 merging d (no-changeset !)
478 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (no-changeset !)
478 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (no-changeset !)
479 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
479 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
480 (branch merge, don't forget to commit)
480 (branch merge, don't forget to commit)
481 $ hg ci -m "mFGm-0 $case_desc - one way"
481 $ hg ci -m "mFGm-0 $case_desc - one way"
482 created new head
482 created new head
483 $ hg up 'desc("g-1")'
483 $ hg up 'desc("g-1")'
484 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
484 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
485 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
485 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
486 $ hg merge 'desc("f-2")' --tool :union
486 $ hg merge 'desc("f-2")' --tool :union
487 merging d (no-changeset !)
487 merging d (no-changeset !)
488 0 files updated, 1 files merged, 1 files removed, 0 files unresolved (no-changeset !)
488 0 files updated, 1 files merged, 1 files removed, 0 files unresolved (no-changeset !)
489 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
489 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
490 (branch merge, don't forget to commit)
490 (branch merge, don't forget to commit)
491 $ hg ci -m "mGFm-0 $case_desc - the other way"
491 $ hg ci -m "mGFm-0 $case_desc - the other way"
492 created new head
492 created new head
493 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
493 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
494 @ 29 mGFm-0 simple merge - the other way
494 @ 29 mGFm-0 simple merge - the other way
495 |\
495 |\
496 +---o 28 mFGm-0 simple merge - one way
496 +---o 28 mFGm-0 simple merge - one way
497 | |/
497 | |/
498 | o 25 g-1: update d
498 | o 25 g-1: update d
499 | |
499 | |
500 o | 22 f-2: rename i -> d
500 o | 22 f-2: rename i -> d
501 | |
501 | |
502 o | 21 f-1: rename h -> i
502 o | 21 f-1: rename h -> i
503 |/
503 |/
504 o 2 i-2: c -move-> d
504 o 2 i-2: c -move-> d
505 |
505 |
506 o 1 i-1: a -move-> c
506 o 1 i-1: a -move-> c
507 |
507 |
508 o 0 i-0 initial commit: a b h
508 o 0 i-0 initial commit: a b h
509
509
510
510
511
511
512 Comparing with merging with a deletion (and keeping the file)
512 Comparing with merging with a deletion (and keeping the file)
513 -------------------------------------------------------------
513 -------------------------------------------------------------
514
514
515 Merge:
515 Merge:
516 - one removing a file (d)
516 - one removing a file (d)
517 - one updating that file
517 - one updating that file
518 - the merge keep the modified version of the file (canceling the delete)
518 - the merge keep the modified version of the file (canceling the delete)
519
519
520 In this case, the file keep on living after the merge. So we should not drop its
520 In this case, the file keep on living after the merge. So we should not drop its
521 copy tracing chain.
521 copy tracing chain.
522
522
523 $ hg up 'desc("c-1")'
523 $ hg up 'desc("c-1")'
524 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
524 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
525 $ hg merge 'desc("g-1")'
525 $ hg merge 'desc("g-1")'
526 file 'd' was deleted in local [working copy] but was modified in other [merge rev].
526 file 'd' was deleted in local [working copy] but was modified in other [merge rev].
527 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
527 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
528 What do you want to do? u
528 What do you want to do? u
529 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
529 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
530 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
530 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
531 [1]
531 [1]
532 $ hg resolve -t :other d
532 $ hg resolve -t :other d
533 (no more unresolved files)
533 (no more unresolved files)
534 $ hg ci -m "mCGm-0"
534 $ hg ci -m "mCGm-0"
535 created new head
535 created new head
536
536
537 $ hg up 'desc("g-1")'
537 $ hg up 'desc("g-1")'
538 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
538 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
539 $ hg merge 'desc("c-1")'
539 $ hg merge 'desc("c-1")'
540 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
540 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
541 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
541 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
542 What do you want to do? u
542 What do you want to do? u
543 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
543 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
544 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
544 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
545 [1]
545 [1]
546 $ hg resolve -t :local d
546 $ hg resolve -t :local d
547 (no more unresolved files)
547 (no more unresolved files)
548 $ hg ci -m "mGCm-0"
548 $ hg ci -m "mGCm-0"
549 created new head
549 created new head
550
550
551 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
551 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
552 @ 31 mGCm-0
552 @ 31 mGCm-0
553 |\
553 |\
554 +---o 30 mCGm-0
554 +---o 30 mCGm-0
555 | |/
555 | |/
556 | o 25 g-1: update d
556 | o 25 g-1: update d
557 | |
557 | |
558 o | 6 c-1 delete d
558 o | 6 c-1 delete d
559 |/
559 |/
560 o 2 i-2: c -move-> d
560 o 2 i-2: c -move-> d
561 |
561 |
562 o 1 i-1: a -move-> c
562 o 1 i-1: a -move-> c
563 |
563 |
564 o 0 i-0 initial commit: a b h
564 o 0 i-0 initial commit: a b h
565
565
566
566
567
567
568
568
569 Comparing with merge restoring an untouched deleted file
569 Comparing with merge restoring an untouched deleted file
570 --------------------------------------------------------
570 --------------------------------------------------------
571
571
572 Merge:
572 Merge:
573 - one removing a file (d)
573 - one removing a file (d)
574 - one leaving the file untouched
574 - one leaving the file untouched
575 - the merge actively restore the file to the same content.
575 - the merge actively restore the file to the same content.
576
576
577 In this case, the file keep on living after the merge. So we should not drop its
577 In this case, the file keep on living after the merge. So we should not drop its
578 copy tracing chain.
578 copy tracing chain.
579
579
580 $ hg up 'desc("c-1")'
580 $ hg up 'desc("c-1")'
581 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
581 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
582 $ hg merge 'desc("b-1")'
582 $ hg merge 'desc("b-1")'
583 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
583 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
584 (branch merge, don't forget to commit)
584 (branch merge, don't forget to commit)
585 $ hg revert --rev 'desc("b-1")' d
585 $ hg revert --rev 'desc("b-1")' d
586 $ hg ci -m "mCB-revert-m-0"
586 $ hg ci -m "mCB-revert-m-0"
587 created new head
587 created new head
588
588
589 $ hg up 'desc("b-1")'
589 $ hg up 'desc("b-1")'
590 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
590 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
591 $ hg merge 'desc("c-1")'
591 $ hg merge 'desc("c-1")'
592 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
592 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
593 (branch merge, don't forget to commit)
593 (branch merge, don't forget to commit)
594 $ hg revert --rev 'desc("b-1")' d
594 $ hg revert --rev 'desc("b-1")' d
595 $ hg ci -m "mBC-revert-m-0"
595 $ hg ci -m "mBC-revert-m-0"
596 created new head
596 created new head
597
597
598 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
598 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
599 @ 33 mBC-revert-m-0
599 @ 33 mBC-revert-m-0
600 |\
600 |\
601 +---o 32 mCB-revert-m-0
601 +---o 32 mCB-revert-m-0
602 | |/
602 | |/
603 | o 6 c-1 delete d
603 | o 6 c-1 delete d
604 | |
604 | |
605 o | 5 b-1: b update
605 o | 5 b-1: b update
606 |/
606 |/
607 o 2 i-2: c -move-> d
607 o 2 i-2: c -move-> d
608 |
608 |
609 o 1 i-1: a -move-> c
609 o 1 i-1: a -move-> c
610 |
610 |
611 o 0 i-0 initial commit: a b h
611 o 0 i-0 initial commit: a b h
612
612
613
613
614
614
615 $ hg up null --quiet
615 $ hg up null --quiet
616
616
617 Merging a branch where a rename was deleted with a branch where the same file was renamed
617 Merging a branch where a rename was deleted with a branch where the same file was renamed
618 ------------------------------------------------------------------------------------------
618 ------------------------------------------------------------------------------------------
619
619
620 Create a "conflicting" merge where `d` get removed on one branch before its
620 Create a "conflicting" merge where `d` get removed on one branch before its
621 rename information actually conflict with the other branch.
621 rename information actually conflict with the other branch.
622
622
623 (the copy information from the branch that was not deleted should win).
623 (the copy information from the branch that was not deleted should win).
624
624
625 $ hg up 'desc("i-0")'
625 $ hg up 'desc("i-0")'
626 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
626 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
627 $ hg mv b d
627 $ hg mv b d
628 $ hg ci -m "h-1: b -(move)-> d"
628 $ hg ci -m "h-1: b -(move)-> d"
629 created new head
629 created new head
630
630
631 $ hg up 'desc("c-1")'
631 $ hg up 'desc("c-1")'
632 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
632 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
633 $ hg merge 'desc("h-1")'
633 $ hg merge 'desc("h-1")'
634 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
634 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
635 (branch merge, don't forget to commit)
635 (branch merge, don't forget to commit)
636 $ hg ci -m "mCH-delete-before-conflict-m-0"
636 $ hg ci -m "mCH-delete-before-conflict-m-0"
637
637
638 $ hg up 'desc("h-1")'
638 $ hg up 'desc("h-1")'
639 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
639 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
640 $ hg merge 'desc("c-1")'
640 $ hg merge 'desc("c-1")'
641 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
641 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
642 (branch merge, don't forget to commit)
642 (branch merge, don't forget to commit)
643 $ hg ci -m "mHC-delete-before-conflict-m-0"
643 $ hg ci -m "mHC-delete-before-conflict-m-0"
644 created new head
644 created new head
645 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
645 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
646 @ 36 mHC-delete-before-conflict-m-0
646 @ 36 mHC-delete-before-conflict-m-0
647 |\
647 |\
648 +---o 35 mCH-delete-before-conflict-m-0
648 +---o 35 mCH-delete-before-conflict-m-0
649 | |/
649 | |/
650 | o 34 h-1: b -(move)-> d
650 | o 34 h-1: b -(move)-> d
651 | |
651 | |
652 o | 6 c-1 delete d
652 o | 6 c-1 delete d
653 | |
653 | |
654 o | 2 i-2: c -move-> d
654 o | 2 i-2: c -move-> d
655 | |
655 | |
656 o | 1 i-1: a -move-> c
656 o | 1 i-1: a -move-> c
657 |/
657 |/
658 o 0 i-0 initial commit: a b h
658 o 0 i-0 initial commit: a b h
659
659
660
660
661
661
662 Summary of all created cases
662 Summary of all created cases
663 ----------------------------
663 ----------------------------
664
664
665 $ hg up --quiet null
665 $ hg up --quiet null
666
666
667 (This exists to help keeping a compact list of the various cases we have built)
667 (This exists to help keeping a compact list of the various cases we have built)
668
668
669 $ hg log -T '{desc|firstline}\n'| sort
669 $ hg log -T '{desc|firstline}\n'| sort
670 a-1: d -move-> e
670 a-1: d -move-> e
671 a-2: e -move-> f
671 a-2: e -move-> f
672 b-1: b update
672 b-1: b update
673 c-1 delete d
673 c-1 delete d
674 d-1 delete d
674 d-1 delete d
675 d-2 re-add d
675 d-2 re-add d
676 e-1 b -move-> g
676 e-1 b -move-> g
677 e-2 g -move-> f
677 e-2 g -move-> f
678 f-1: rename h -> i
678 f-1: rename h -> i
679 f-2: rename i -> d
679 f-2: rename i -> d
680 g-1: update d
680 g-1: update d
681 h-1: b -(move)-> d
681 h-1: b -(move)-> d
682 i-0 initial commit: a b h
682 i-0 initial commit: a b h
683 i-1: a -move-> c
683 i-1: a -move-> c
684 i-2: c -move-> d
684 i-2: c -move-> d
685 mABm-0 simple merge - the other way
685 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
686 mAEm-0 simple merge - one way
686 mAEm-0 simple merge - one way
687 mBAm-0 simple merge - one way
687 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
688 mBC-revert-m-0
688 mBC-revert-m-0
689 mBCm-0 simple merge - one way
689 mBCm-0 simple merge - one way
690 mBCm-1 re-add d
690 mBCm-1 re-add d
691 mBDm-0 simple merge - one way
691 mBDm-0 simple merge - one way
692 mBFm-0 simple merge - one way
692 mBFm-0 simple merge - one way
693 mCB-revert-m-0
693 mCB-revert-m-0
694 mCBm-0 simple merge - the other way
694 mCBm-0 simple merge - the other way
695 mCBm-1 re-add d
695 mCBm-1 re-add d
696 mCGm-0
696 mCGm-0
697 mCH-delete-before-conflict-m-0
697 mCH-delete-before-conflict-m-0
698 mDBm-0 simple merge - the other way
698 mDBm-0 simple merge - the other way
699 mDGm-0 simple merge - one way
699 mDGm-0 simple merge - one way
700 mEAm-0 simple merge - the other way
700 mEAm-0 simple merge - the other way
701 mFBm-0 simple merge - the other way
701 mFBm-0 simple merge - the other way
702 mFGm-0 simple merge - one way
702 mFGm-0 simple merge - one way
703 mGCm-0
703 mGCm-0
704 mGDm-0 simple merge - the other way
704 mGDm-0 simple merge - the other way
705 mGFm-0 simple merge - the other way
705 mGFm-0 simple merge - the other way
706 mHC-delete-before-conflict-m-0
706 mHC-delete-before-conflict-m-0
707
707
708
708
709 Test that sidedata computations during upgrades are correct
709 Test that sidedata computations during upgrades are correct
710 ===========================================================
710 ===========================================================
711
711
712 We upgrade a repository that is not using sidedata (the filelog case) and
712 We upgrade a repository that is not using sidedata (the filelog case) and
713 check that the same side data have been generated as if they were computed at
713 check that the same side data have been generated as if they were computed at
714 commit time.
714 commit time.
715
715
716
716
717 #if upgraded
717 #if upgraded
718 $ cat >> $HGRCPATH << EOF
718 $ cat >> $HGRCPATH << EOF
719 > [format]
719 > [format]
720 > exp-use-side-data = yes
720 > exp-use-side-data = yes
721 > exp-use-copies-side-data-changeset = yes
721 > exp-use-copies-side-data-changeset = yes
722 > EOF
722 > EOF
723 $ hg debugformat -v
723 $ hg debugformat -v
724 format-variant repo config default
724 format-variant repo config default
725 fncache: yes yes yes
725 fncache: yes yes yes
726 dotencode: yes yes yes
726 dotencode: yes yes yes
727 generaldelta: yes yes yes
727 generaldelta: yes yes yes
728 share-safe: no no no
728 share-safe: no no no
729 sparserevlog: yes yes yes
729 sparserevlog: yes yes yes
730 sidedata: no yes no
730 sidedata: no yes no
731 persistent-nodemap: no no no
731 persistent-nodemap: no no no
732 copies-sdc: no yes no
732 copies-sdc: no yes no
733 plain-cl-delta: yes yes yes
733 plain-cl-delta: yes yes yes
734 compression: * (glob)
734 compression: * (glob)
735 compression-level: default default default
735 compression-level: default default default
736 $ hg debugupgraderepo --run --quiet
736 $ hg debugupgraderepo --run --quiet
737 upgrade will perform the following actions:
737 upgrade will perform the following actions:
738
738
739 requirements
739 requirements
740 preserved: * (glob)
740 preserved: * (glob)
741 added: exp-copies-sidedata-changeset, exp-sidedata-flag
741 added: exp-copies-sidedata-changeset, exp-sidedata-flag
742
742
743 processed revlogs:
743 processed revlogs:
744 - all-filelogs
744 - all-filelogs
745 - changelog
745 - changelog
746 - manifest
746 - manifest
747
747
748 #endif
748 #endif
749
749
750
750
751 #if no-compatibility no-filelog no-changeset
751 #if no-compatibility no-filelog no-changeset
752
752
753 $ hg debugchangedfiles --compute 0
753 $ hg debugchangedfiles --compute 0
754 added : a, ;
754 added : a, ;
755 added : b, ;
755 added : b, ;
756 added : h, ;
756 added : h, ;
757
757
758 $ for rev in `hg log --rev 'all()' -T '{rev}\n'`; do
758 $ for rev in `hg log --rev 'all()' -T '{rev}\n'`; do
759 > echo "##### revision $rev #####"
759 > echo "##### revision $rev #####"
760 > hg debugsidedata -c -v -- $rev
760 > hg debugsidedata -c -v -- $rev
761 > hg debugchangedfiles $rev
761 > hg debugchangedfiles $rev
762 > done
762 > done
763 ##### revision 0 #####
763 ##### revision 0 #####
764 1 sidedata entries
764 1 sidedata entries
765 entry-0014 size 34
765 entry-0014 size 34
766 '\x00\x00\x00\x03\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\x00abh'
766 '\x00\x00\x00\x03\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\x00abh'
767 added : a, ;
767 added : a, ;
768 added : b, ;
768 added : b, ;
769 added : h, ;
769 added : h, ;
770 ##### revision 1 #####
770 ##### revision 1 #####
771 1 sidedata entries
771 1 sidedata entries
772 entry-0014 size 24
772 entry-0014 size 24
773 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ac'
773 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ac'
774 removed : a, ;
774 removed : a, ;
775 added p1: c, a;
775 added p1: c, a;
776 ##### revision 2 #####
776 ##### revision 2 #####
777 1 sidedata entries
777 1 sidedata entries
778 entry-0014 size 24
778 entry-0014 size 24
779 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00cd'
779 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00cd'
780 removed : c, ;
780 removed : c, ;
781 added p1: d, c;
781 added p1: d, c;
782 ##### revision 3 #####
782 ##### revision 3 #####
783 1 sidedata entries
783 1 sidedata entries
784 entry-0014 size 24
784 entry-0014 size 24
785 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00de'
785 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00de'
786 removed : d, ;
786 removed : d, ;
787 added p1: e, d;
787 added p1: e, d;
788 ##### revision 4 #####
788 ##### revision 4 #####
789 1 sidedata entries
789 1 sidedata entries
790 entry-0014 size 24
790 entry-0014 size 24
791 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ef'
791 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ef'
792 removed : e, ;
792 removed : e, ;
793 added p1: f, e;
793 added p1: f, e;
794 ##### revision 5 #####
794 ##### revision 5 #####
795 1 sidedata entries
795 1 sidedata entries
796 entry-0014 size 14
796 entry-0014 size 14
797 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00b'
797 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00b'
798 touched : b, ;
798 touched : b, ;
799 ##### revision 6 #####
799 ##### revision 6 #####
800 1 sidedata entries
800 1 sidedata entries
801 entry-0014 size 14
801 entry-0014 size 14
802 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
802 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
803 removed : d, ;
803 removed : d, ;
804 ##### revision 7 #####
804 ##### revision 7 #####
805 1 sidedata entries
805 1 sidedata entries
806 entry-0014 size 14
806 entry-0014 size 14
807 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
807 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
808 removed : d, ;
808 removed : d, ;
809 ##### revision 8 #####
809 ##### revision 8 #####
810 1 sidedata entries
810 1 sidedata entries
811 entry-0014 size 14
811 entry-0014 size 14
812 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
812 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
813 added : d, ;
813 added : d, ;
814 ##### revision 9 #####
814 ##### revision 9 #####
815 1 sidedata entries
815 1 sidedata entries
816 entry-0014 size 24
816 entry-0014 size 24
817 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bg'
817 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bg'
818 removed : b, ;
818 removed : b, ;
819 added p1: g, b;
819 added p1: g, b;
820 ##### revision 10 #####
820 ##### revision 10 #####
821 1 sidedata entries
821 1 sidedata entries
822 entry-0014 size 24
822 entry-0014 size 24
823 '\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00fg'
823 '\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00fg'
824 added p1: f, g;
824 added p1: f, g;
825 removed : g, ;
825 removed : g, ;
826 ##### revision 11 #####
826 ##### revision 11 #####
827 1 sidedata entries
827 1 sidedata entries
828 entry-0014 size 4
828 entry-0014 size 4
829 '\x00\x00\x00\x00'
829 '\x00\x00\x00\x00'
830 ##### revision 12 #####
830 ##### revision 12 #####
831 1 sidedata entries
831 1 sidedata entries
832 entry-0014 size 4
832 entry-0014 size 4
833 '\x00\x00\x00\x00'
833 '\x00\x00\x00\x00'
834 ##### revision 13 #####
834 ##### revision 13 #####
835 1 sidedata entries
835 1 sidedata entries
836 entry-0014 size 4
836 entry-0014 size 4
837 '\x00\x00\x00\x00'
837 '\x00\x00\x00\x00'
838 ##### revision 14 #####
838 ##### revision 14 #####
839 1 sidedata entries
839 1 sidedata entries
840 entry-0014 size 14
840 entry-0014 size 14
841 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
841 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
842 added : d, ;
842 added : d, ;
843 ##### revision 15 #####
843 ##### revision 15 #####
844 1 sidedata entries
844 1 sidedata entries
845 entry-0014 size 4
845 entry-0014 size 4
846 '\x00\x00\x00\x00'
846 '\x00\x00\x00\x00'
847 ##### revision 16 #####
847 ##### revision 16 #####
848 1 sidedata entries
848 1 sidedata entries
849 entry-0014 size 14
849 entry-0014 size 14
850 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
850 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
851 added : d, ;
851 added : d, ;
852 ##### revision 17 #####
852 ##### revision 17 #####
853 1 sidedata entries
853 1 sidedata entries
854 entry-0014 size 4
854 entry-0014 size 4
855 '\x00\x00\x00\x00'
855 '\x00\x00\x00\x00'
856 ##### revision 18 #####
856 ##### revision 18 #####
857 1 sidedata entries
857 1 sidedata entries
858 entry-0014 size 4
858 entry-0014 size 4
859 '\x00\x00\x00\x00'
859 '\x00\x00\x00\x00'
860 ##### revision 19 #####
860 ##### revision 19 #####
861 1 sidedata entries
861 1 sidedata entries
862 entry-0014 size 14
862 entry-0014 size 14
863 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
863 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
864 merged : f, ;
864 merged : f, ;
865 ##### revision 20 #####
865 ##### revision 20 #####
866 1 sidedata entries
866 1 sidedata entries
867 entry-0014 size 14
867 entry-0014 size 14
868 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
868 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
869 merged : f, ;
869 merged : f, ;
870 ##### revision 21 #####
870 ##### revision 21 #####
871 1 sidedata entries
871 1 sidedata entries
872 entry-0014 size 24
872 entry-0014 size 24
873 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00hi'
873 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00hi'
874 removed : h, ;
874 removed : h, ;
875 added p1: i, h;
875 added p1: i, h;
876 ##### revision 22 #####
876 ##### revision 22 #####
877 1 sidedata entries
877 1 sidedata entries
878 entry-0014 size 24
878 entry-0014 size 24
879 '\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00di'
879 '\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00di'
880 touched p1: d, i;
880 touched p1: d, i;
881 removed : i, ;
881 removed : i, ;
882 ##### revision 23 #####
882 ##### revision 23 #####
883 1 sidedata entries
883 1 sidedata entries
884 entry-0014 size 4
884 entry-0014 size 4
885 '\x00\x00\x00\x00'
885 '\x00\x00\x00\x00'
886 ##### revision 24 #####
886 ##### revision 24 #####
887 1 sidedata entries
887 1 sidedata entries
888 entry-0014 size 4
888 entry-0014 size 4
889 '\x00\x00\x00\x00'
889 '\x00\x00\x00\x00'
890 ##### revision 25 #####
890 ##### revision 25 #####
891 1 sidedata entries
891 1 sidedata entries
892 entry-0014 size 14
892 entry-0014 size 14
893 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
893 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
894 touched : d, ;
894 touched : d, ;
895 ##### revision 26 #####
895 ##### revision 26 #####
896 1 sidedata entries
896 1 sidedata entries
897 entry-0014 size 14
897 entry-0014 size 14
898 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
898 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
899 merged : d, ;
899 merged : d, ;
900 ##### revision 27 #####
900 ##### revision 27 #####
901 1 sidedata entries
901 1 sidedata entries
902 entry-0014 size 14
902 entry-0014 size 14
903 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
903 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
904 merged : d, ;
904 merged : d, ;
905 ##### revision 28 #####
905 ##### revision 28 #####
906 1 sidedata entries
906 1 sidedata entries
907 entry-0014 size 14
907 entry-0014 size 14
908 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
908 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
909 merged : d, ;
909 merged : d, ;
910 ##### revision 29 #####
910 ##### revision 29 #####
911 1 sidedata entries
911 1 sidedata entries
912 entry-0014 size 14
912 entry-0014 size 14
913 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
913 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
914 merged : d, ;
914 merged : d, ;
915 ##### revision 30 #####
915 ##### revision 30 #####
916 1 sidedata entries
916 1 sidedata entries
917 entry-0014 size 14
917 entry-0014 size 14
918 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
918 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
919 salvaged : d, ;
919 salvaged : d, ;
920 ##### revision 31 #####
920 ##### revision 31 #####
921 1 sidedata entries
921 1 sidedata entries
922 entry-0014 size 14
922 entry-0014 size 14
923 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
923 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
924 salvaged : d, ;
924 salvaged : d, ;
925 ##### revision 32 #####
925 ##### revision 32 #####
926 1 sidedata entries
926 1 sidedata entries
927 entry-0014 size 14
927 entry-0014 size 14
928 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
928 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
929 salvaged : d, ;
929 salvaged : d, ;
930 ##### revision 33 #####
930 ##### revision 33 #####
931 1 sidedata entries
931 1 sidedata entries
932 entry-0014 size 14
932 entry-0014 size 14
933 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
933 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
934 salvaged : d, ;
934 salvaged : d, ;
935 ##### revision 34 #####
935 ##### revision 34 #####
936 1 sidedata entries
936 1 sidedata entries
937 entry-0014 size 24
937 entry-0014 size 24
938 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bd'
938 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bd'
939 removed : b, ;
939 removed : b, ;
940 added p1: d, b;
940 added p1: d, b;
941 ##### revision 35 #####
941 ##### revision 35 #####
942 1 sidedata entries
942 1 sidedata entries
943 entry-0014 size 4
943 entry-0014 size 4
944 '\x00\x00\x00\x00'
944 '\x00\x00\x00\x00'
945 ##### revision 36 #####
945 ##### revision 36 #####
946 1 sidedata entries
946 1 sidedata entries
947 entry-0014 size 4
947 entry-0014 size 4
948 '\x00\x00\x00\x00'
948 '\x00\x00\x00\x00'
949
949
950 #endif
950 #endif
951
951
952
952
953 Test copy information chaining
953 Test copy information chaining
954 ==============================
954 ==============================
955
955
956 Check that matching only affect the destination and not intermediate path
956 Check that matching only affect the destination and not intermediate path
957 -------------------------------------------------------------------------
957 -------------------------------------------------------------------------
958
958
959 The two status call should give the same value for f
959 The two status call should give the same value for f
960
960
961 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")'
961 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")'
962 A f
962 A f
963 a
963 a
964 R a
964 R a
965 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")' f
965 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")' f
966 A f
966 A f
967 a (no-changeset no-compatibility !)
967 a (no-changeset no-compatibility !)
968
968
969 merging with unrelated change does not interfere with the renames
969 merging with unrelated change does not interfere with the renames
970 ---------------------------------------------------------------
970 ---------------------------------------------------------------
971
971
972 - rename on one side
972 - rename on one side
973 - unrelated change on the other side
973 - unrelated change on the other side
974
974
975 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
975 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
976 o 12 mABm-0 simple merge - the other way
976 o 12 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
977 |\
977 |\
978 +---o 11 mBAm-0 simple merge - one way
978 +---o 11 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
979 | |/
979 | |/
980 | o 5 b-1: b update
980 | o 5 b-1: b update
981 | |
981 | |
982 o | 4 a-2: e -move-> f
982 o | 4 a-2: e -move-> f
983 | |
983 | |
984 o | 3 a-1: d -move-> e
984 o | 3 a-1: d -move-> e
985 |/
985 |/
986 o 2 i-2: c -move-> d
986 o 2 i-2: c -move-> d
987 |
987 |
988 o 1 i-1: a -move-> c
988 o 1 i-1: a -move-> c
989 |
989 |
990 o 0 i-0 initial commit: a b h
990 o 0 i-0 initial commit: a b h
991
991
992
992
993 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
993 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
994 A f
994 A f
995 d
995 d
996 R d
996 R d
997 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
997 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
998 A f
998 A f
999 d
999 d
1000 R d
1000 R d
1001 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
1001 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
1002 M b
1002 M b
1003 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
1003 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
1004 M b
1004 M b
1005 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
1005 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
1006 M b
1006 M b
1007 A f
1007 A f
1008 d
1008 d
1009 R d
1009 R d
1010 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
1010 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
1011 M b
1011 M b
1012 A f
1012 A f
1013 d
1013 d
1014 R d
1014 R d
1015 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
1015 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
1016 M b
1016 M b
1017 A f
1017 A f
1018 a
1018 a
1019 R a
1019 R a
1020 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
1020 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
1021 M b
1021 M b
1022 A f
1022 A f
1023 a
1023 a
1024 R a
1024 R a
1025
1025
1026 merging with the side having a delete
1026 merging with the side having a delete
1027 -------------------------------------
1027 -------------------------------------
1028
1028
1029 case summary:
1029 case summary:
1030 - one with change to an unrelated file
1030 - one with change to an unrelated file
1031 - one deleting the change
1031 - one deleting the change
1032 and recreate an unrelated file after the merge
1032 and recreate an unrelated file after the merge
1033
1033
1034 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
1034 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
1035 o 16 mCBm-1 re-add d
1035 o 16 mCBm-1 re-add d
1036 |
1036 |
1037 o 15 mCBm-0 simple merge - the other way
1037 o 15 mCBm-0 simple merge - the other way
1038 |\
1038 |\
1039 | | o 14 mBCm-1 re-add d
1039 | | o 14 mBCm-1 re-add d
1040 | | |
1040 | | |
1041 +---o 13 mBCm-0 simple merge - one way
1041 +---o 13 mBCm-0 simple merge - one way
1042 | |/
1042 | |/
1043 | o 6 c-1 delete d
1043 | o 6 c-1 delete d
1044 | |
1044 | |
1045 o | 5 b-1: b update
1045 o | 5 b-1: b update
1046 |/
1046 |/
1047 o 2 i-2: c -move-> d
1047 o 2 i-2: c -move-> d
1048 |
1048 |
1049 o 1 i-1: a -move-> c
1049 o 1 i-1: a -move-> c
1050 |
1050 |
1051 o 0 i-0 initial commit: a b h
1051 o 0 i-0 initial commit: a b h
1052
1052
1053 - comparing from the merge
1053 - comparing from the merge
1054
1054
1055 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
1055 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
1056 R d
1056 R d
1057 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
1057 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
1058 R d
1058 R d
1059 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
1059 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
1060 M b
1060 M b
1061 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
1061 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
1062 M b
1062 M b
1063 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
1063 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
1064 M b
1064 M b
1065 R d
1065 R d
1066 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
1066 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
1067 M b
1067 M b
1068 R d
1068 R d
1069 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
1069 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
1070 M b
1070 M b
1071 R a
1071 R a
1072 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
1072 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
1073 M b
1073 M b
1074 R a
1074 R a
1075
1075
1076 - comparing with the merge children re-adding the file
1076 - comparing with the merge children re-adding the file
1077
1077
1078 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
1078 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
1079 M d
1079 M d
1080 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
1080 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
1081 M d
1081 M d
1082 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
1082 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
1083 M b
1083 M b
1084 A d
1084 A d
1085 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
1085 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
1086 M b
1086 M b
1087 A d
1087 A d
1088 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
1088 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
1089 M b
1089 M b
1090 M d
1090 M d
1091 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
1091 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
1092 M b
1092 M b
1093 M d
1093 M d
1094 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
1094 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
1095 M b
1095 M b
1096 A d
1096 A d
1097 R a
1097 R a
1098 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
1098 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
1099 M b
1099 M b
1100 A d
1100 A d
1101 R a
1101 R a
1102
1102
1103 Comparing with a merge re-adding the file afterward
1103 Comparing with a merge re-adding the file afterward
1104 ---------------------------------------------------
1104 ---------------------------------------------------
1105
1105
1106 Merge:
1106 Merge:
1107 - one with change to an unrelated file
1107 - one with change to an unrelated file
1108 - one deleting and recreating the change
1108 - one deleting and recreating the change
1109
1109
1110 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
1110 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
1111 o 18 mDBm-0 simple merge - the other way
1111 o 18 mDBm-0 simple merge - the other way
1112 |\
1112 |\
1113 +---o 17 mBDm-0 simple merge - one way
1113 +---o 17 mBDm-0 simple merge - one way
1114 | |/
1114 | |/
1115 | o 8 d-2 re-add d
1115 | o 8 d-2 re-add d
1116 | |
1116 | |
1117 | o 7 d-1 delete d
1117 | o 7 d-1 delete d
1118 | |
1118 | |
1119 o | 5 b-1: b update
1119 o | 5 b-1: b update
1120 |/
1120 |/
1121 o 2 i-2: c -move-> d
1121 o 2 i-2: c -move-> d
1122 |
1122 |
1123 o 1 i-1: a -move-> c
1123 o 1 i-1: a -move-> c
1124 |
1124 |
1125 o 0 i-0 initial commit: a b h
1125 o 0 i-0 initial commit: a b h
1126
1126
1127 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
1127 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
1128 M d
1128 M d
1129 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
1129 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
1130 M d
1130 M d
1131 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
1131 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
1132 M b
1132 M b
1133 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
1133 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
1134 M b
1134 M b
1135 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
1135 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
1136 M b
1136 M b
1137 M d
1137 M d
1138 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
1138 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
1139 M b
1139 M b
1140 M d
1140 M d
1141
1141
1142 The bugs makes recorded copy is different depending of where we started the merge from since
1142 The bugs makes recorded copy is different depending of where we started the merge from since
1143
1143
1144 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
1144 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
1145 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1145 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1146 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
1146 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
1147 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1147 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1148
1148
1149 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
1149 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
1150 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1150 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1151 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
1151 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
1152 d8252ab2e760b0d4e5288fd44cbd15a0fa567e16 644 d (no-changeset !)
1152 d8252ab2e760b0d4e5288fd44cbd15a0fa567e16 644 d (no-changeset !)
1153 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
1153 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
1154 $ hg debugindex d | head -n 4
1154 $ hg debugindex d | head -n 4
1155 rev linkrev nodeid p1 p2
1155 rev linkrev nodeid p1 p2
1156 0 2 d8252ab2e760 000000000000 000000000000 (no-changeset !)
1156 0 2 d8252ab2e760 000000000000 000000000000 (no-changeset !)
1157 0 2 ae258f702dfe 000000000000 000000000000 (changeset !)
1157 0 2 ae258f702dfe 000000000000 000000000000 (changeset !)
1158 1 8 b004912a8510 000000000000 000000000000
1158 1 8 b004912a8510 000000000000 000000000000
1159 2 22 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
1159 2 22 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
1160 2 25 5cce88bf349f ae258f702dfe 000000000000 (changeset !)
1160 2 25 5cce88bf349f ae258f702dfe 000000000000 (changeset !)
1161
1161
1162 Log output should not include a merge commit as it did not happen
1162 Log output should not include a merge commit as it did not happen
1163
1163
1164 $ hg log -Gfr 'desc("mBDm-0")' d
1164 $ hg log -Gfr 'desc("mBDm-0")' d
1165 o 8 d-2 re-add d
1165 o 8 d-2 re-add d
1166 |
1166 |
1167 ~
1167 ~
1168
1168
1169 $ hg log -Gfr 'desc("mDBm-0")' d
1169 $ hg log -Gfr 'desc("mDBm-0")' d
1170 o 8 d-2 re-add d
1170 o 8 d-2 re-add d
1171 |
1171 |
1172 ~
1172 ~
1173
1173
1174 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
1174 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
1175 M b
1175 M b
1176 A d
1176 A d
1177 R a
1177 R a
1178 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
1178 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
1179 M b
1179 M b
1180 A d
1180 A d
1181 R a
1181 R a
1182
1182
1183
1183
1184 Comparing with a merge with colliding rename
1184 Comparing with a merge with colliding rename
1185 --------------------------------------------
1185 --------------------------------------------
1186
1186
1187 - the "e-" branch renaming b to f (through 'g')
1187 - the "e-" branch renaming b to f (through 'g')
1188 - the "a-" branch renaming d to f (through e)
1188 - the "a-" branch renaming d to f (through e)
1189
1189
1190 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
1190 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
1191 o 20 mEAm-0 simple merge - the other way
1191 o 20 mEAm-0 simple merge - the other way
1192 |\
1192 |\
1193 +---o 19 mAEm-0 simple merge - one way
1193 +---o 19 mAEm-0 simple merge - one way
1194 | |/
1194 | |/
1195 | o 10 e-2 g -move-> f
1195 | o 10 e-2 g -move-> f
1196 | |
1196 | |
1197 | o 9 e-1 b -move-> g
1197 | o 9 e-1 b -move-> g
1198 | |
1198 | |
1199 o | 4 a-2: e -move-> f
1199 o | 4 a-2: e -move-> f
1200 | |
1200 | |
1201 o | 3 a-1: d -move-> e
1201 o | 3 a-1: d -move-> e
1202 |/
1202 |/
1203 o 2 i-2: c -move-> d
1203 o 2 i-2: c -move-> d
1204 |
1204 |
1205 o 1 i-1: a -move-> c
1205 o 1 i-1: a -move-> c
1206 |
1206 |
1207 o 0 i-0 initial commit: a b h
1207 o 0 i-0 initial commit: a b h
1208
1208
1209 #if no-changeset
1209 #if no-changeset
1210 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1210 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1211 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1211 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1212 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1212 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1213 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1213 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1214 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1214 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1215 b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f
1215 b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f
1216 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1216 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1217 e8825b386367b29fec957283a80bb47b47483fe1 644 f
1217 e8825b386367b29fec957283a80bb47b47483fe1 644 f
1218 $ hg debugindex f
1218 $ hg debugindex f
1219 rev linkrev nodeid p1 p2
1219 rev linkrev nodeid p1 p2
1220 0 4 b76eb76580df 000000000000 000000000000
1220 0 4 b76eb76580df 000000000000 000000000000
1221 1 10 e8825b386367 000000000000 000000000000
1221 1 10 e8825b386367 000000000000 000000000000
1222 2 19 2ff93c643948 b76eb76580df e8825b386367
1222 2 19 2ff93c643948 b76eb76580df e8825b386367
1223 #else
1223 #else
1224 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1224 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1225 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1225 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1226 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1226 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1227 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1227 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1228 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1228 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1229 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1229 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1230 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1230 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1231 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1231 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1232 $ hg debugindex f
1232 $ hg debugindex f
1233 rev linkrev nodeid p1 p2
1233 rev linkrev nodeid p1 p2
1234 0 4 ae258f702dfe 000000000000 000000000000
1234 0 4 ae258f702dfe 000000000000 000000000000
1235 #endif
1235 #endif
1236
1236
1237 # Here the filelog based implementation is not looking at the rename
1237 # Here the filelog based implementation is not looking at the rename
1238 # information (because the file exist on both side). However the changelog
1238 # information (because the file exist on both side). However the changelog
1239 # based on works fine. We have different output.
1239 # based on works fine. We have different output.
1240
1240
1241 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
1241 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
1242 M f (no-changeset !)
1242 M f (no-changeset !)
1243 b (no-filelog no-changeset !)
1243 b (no-filelog no-changeset !)
1244 R b
1244 R b
1245 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
1245 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
1246 M f (no-changeset !)
1246 M f (no-changeset !)
1247 b (no-filelog no-changeset !)
1247 b (no-filelog no-changeset !)
1248 R b
1248 R b
1249 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
1249 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
1250 M f (no-changeset !)
1250 M f (no-changeset !)
1251 d (no-filelog no-changeset !)
1251 d (no-filelog no-changeset !)
1252 R d
1252 R d
1253 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
1253 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
1254 M f (no-changeset !)
1254 M f (no-changeset !)
1255 d (no-filelog no-changeset !)
1255 d (no-filelog no-changeset !)
1256 R d
1256 R d
1257 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
1257 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
1258 A f
1258 A f
1259 d
1259 d
1260 R d
1260 R d
1261 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
1261 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
1262 A f
1262 A f
1263 b
1263 b
1264 R b
1264 R b
1265
1265
1266 # From here, we run status against revision where both source file exists.
1266 # From here, we run status against revision where both source file exists.
1267 #
1267 #
1268 # The filelog based implementation picks an arbitrary side based on revision
1268 # The filelog based implementation picks an arbitrary side based on revision
1269 # numbers. So the same side "wins" whatever the parents order is. This is
1269 # numbers. So the same side "wins" whatever the parents order is. This is
1270 # sub-optimal because depending on revision numbers means the result can be
1270 # sub-optimal because depending on revision numbers means the result can be
1271 # different from one repository to the next.
1271 # different from one repository to the next.
1272 #
1272 #
1273 # The changeset based algorithm use the parent order to break tie on conflicting
1273 # The changeset based algorithm use the parent order to break tie on conflicting
1274 # information and will have a different order depending on who is p1 and p2.
1274 # information and will have a different order depending on who is p1 and p2.
1275 # That order is stable accross repositories. (data from p1 prevails)
1275 # That order is stable accross repositories. (data from p1 prevails)
1276
1276
1277 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
1277 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
1278 A f
1278 A f
1279 d
1279 d
1280 R b
1280 R b
1281 R d
1281 R d
1282 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
1282 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
1283 A f
1283 A f
1284 d (filelog !)
1284 d (filelog !)
1285 b (no-filelog !)
1285 b (no-filelog !)
1286 R b
1286 R b
1287 R d
1287 R d
1288 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
1288 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
1289 A f
1289 A f
1290 a
1290 a
1291 R a
1291 R a
1292 R b
1292 R b
1293 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
1293 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
1294 A f
1294 A f
1295 a (filelog !)
1295 a (filelog !)
1296 b (no-filelog !)
1296 b (no-filelog !)
1297 R a
1297 R a
1298 R b
1298 R b
1299
1299
1300
1300
1301 Note:
1301 Note:
1302 | In this case, one of the merge wrongly record a merge while there is none.
1302 | In this case, one of the merge wrongly record a merge while there is none.
1303 | This lead to bad copy tracing information to be dug up.
1303 | This lead to bad copy tracing information to be dug up.
1304
1304
1305
1305
1306 Merge:
1306 Merge:
1307 - one with change to an unrelated file (b)
1307 - one with change to an unrelated file (b)
1308 - one overwriting a file (d) with a rename (from h to i to d)
1308 - one overwriting a file (d) with a rename (from h to i to d)
1309
1309
1310 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
1310 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
1311 o 24 mFBm-0 simple merge - the other way
1311 o 24 mFBm-0 simple merge - the other way
1312 |\
1312 |\
1313 +---o 23 mBFm-0 simple merge - one way
1313 +---o 23 mBFm-0 simple merge - one way
1314 | |/
1314 | |/
1315 | o 22 f-2: rename i -> d
1315 | o 22 f-2: rename i -> d
1316 | |
1316 | |
1317 | o 21 f-1: rename h -> i
1317 | o 21 f-1: rename h -> i
1318 | |
1318 | |
1319 o | 5 b-1: b update
1319 o | 5 b-1: b update
1320 |/
1320 |/
1321 o 2 i-2: c -move-> d
1321 o 2 i-2: c -move-> d
1322 |
1322 |
1323 o 1 i-1: a -move-> c
1323 o 1 i-1: a -move-> c
1324 |
1324 |
1325 o 0 i-0 initial commit: a b h
1325 o 0 i-0 initial commit: a b h
1326
1326
1327 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
1327 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
1328 M b
1328 M b
1329 A d
1329 A d
1330 h
1330 h
1331 R a
1331 R a
1332 R h
1332 R h
1333 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
1333 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
1334 M b
1334 M b
1335 A d
1335 A d
1336 h
1336 h
1337 R a
1337 R a
1338 R h
1338 R h
1339 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
1339 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
1340 M d (no-changeset !)
1340 M d (no-changeset !)
1341 h (no-filelog no-changeset !)
1341 h (no-filelog no-changeset !)
1342 R h
1342 R h
1343 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
1343 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
1344 M b
1344 M b
1345 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
1345 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
1346 M b
1346 M b
1347 M d (no-changeset !)
1347 M d (no-changeset !)
1348 i (no-filelog no-changeset !)
1348 i (no-filelog no-changeset !)
1349 R i
1349 R i
1350 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
1350 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
1351 M d (no-changeset !)
1351 M d (no-changeset !)
1352 h (no-filelog no-changeset !)
1352 h (no-filelog no-changeset !)
1353 R h
1353 R h
1354 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
1354 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
1355 M b
1355 M b
1356 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
1356 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
1357 M b
1357 M b
1358 M d (no-changeset !)
1358 M d (no-changeset !)
1359 i (no-filelog no-changeset !)
1359 i (no-filelog no-changeset !)
1360 R i
1360 R i
1361
1361
1362 #if no-changeset
1362 #if no-changeset
1363 $ hg log -Gfr 'desc("mBFm-0")' d
1363 $ hg log -Gfr 'desc("mBFm-0")' d
1364 o 22 f-2: rename i -> d
1364 o 22 f-2: rename i -> d
1365 |
1365 |
1366 o 21 f-1: rename h -> i
1366 o 21 f-1: rename h -> i
1367 :
1367 :
1368 o 0 i-0 initial commit: a b h
1368 o 0 i-0 initial commit: a b h
1369
1369
1370 #else
1370 #else
1371 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1371 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1372 $ hg log -Gfr 'desc("mBFm-0")' d
1372 $ hg log -Gfr 'desc("mBFm-0")' d
1373 o 2 i-2: c -move-> d
1373 o 2 i-2: c -move-> d
1374 |
1374 |
1375 ~
1375 ~
1376 #endif
1376 #endif
1377
1377
1378 #if no-changeset
1378 #if no-changeset
1379 $ hg log -Gfr 'desc("mFBm-0")' d
1379 $ hg log -Gfr 'desc("mFBm-0")' d
1380 o 22 f-2: rename i -> d
1380 o 22 f-2: rename i -> d
1381 |
1381 |
1382 o 21 f-1: rename h -> i
1382 o 21 f-1: rename h -> i
1383 :
1383 :
1384 o 0 i-0 initial commit: a b h
1384 o 0 i-0 initial commit: a b h
1385
1385
1386 #else
1386 #else
1387 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1387 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1388 $ hg log -Gfr 'desc("mFBm-0")' d
1388 $ hg log -Gfr 'desc("mFBm-0")' d
1389 o 2 i-2: c -move-> d
1389 o 2 i-2: c -move-> d
1390 |
1390 |
1391 ~
1391 ~
1392 #endif
1392 #endif
1393
1393
1394
1394
1395 Merge:
1395 Merge:
1396 - one with change to a file
1396 - one with change to a file
1397 - one deleting and recreating the file
1397 - one deleting and recreating the file
1398
1398
1399 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
1399 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
1400 consider history and rename on both branch of the merge.
1400 consider history and rename on both branch of the merge.
1401
1401
1402 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
1402 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
1403 o 27 mGDm-0 simple merge - the other way
1403 o 27 mGDm-0 simple merge - the other way
1404 |\
1404 |\
1405 +---o 26 mDGm-0 simple merge - one way
1405 +---o 26 mDGm-0 simple merge - one way
1406 | |/
1406 | |/
1407 | o 25 g-1: update d
1407 | o 25 g-1: update d
1408 | |
1408 | |
1409 o | 8 d-2 re-add d
1409 o | 8 d-2 re-add d
1410 | |
1410 | |
1411 o | 7 d-1 delete d
1411 o | 7 d-1 delete d
1412 |/
1412 |/
1413 o 2 i-2: c -move-> d
1413 o 2 i-2: c -move-> d
1414 |
1414 |
1415 o 1 i-1: a -move-> c
1415 o 1 i-1: a -move-> c
1416 |
1416 |
1417 o 0 i-0 initial commit: a b h
1417 o 0 i-0 initial commit: a b h
1418
1418
1419 One side of the merge have a long history with rename. The other side of the
1419 One side of the merge have a long history with rename. The other side of the
1420 merge point to a new file with a smaller history. Each side is "valid".
1420 merge point to a new file with a smaller history. Each side is "valid".
1421
1421
1422 (and again the filelog based algorithm only explore one, with a pick based on
1422 (and again the filelog based algorithm only explore one, with a pick based on
1423 revision numbers)
1423 revision numbers)
1424
1424
1425 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
1425 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
1426 A d
1426 A d
1427 a (filelog !)
1427 a (filelog !)
1428 R a
1428 R a
1429 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
1429 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
1430 A d
1430 A d
1431 a
1431 a
1432 R a
1432 R a
1433 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
1433 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
1434 M d
1434 M d
1435 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
1435 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
1436 M d
1436 M d
1437 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
1437 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
1438 M d
1438 M d
1439 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
1439 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
1440 M d
1440 M d
1441
1441
1442 #if no-changeset
1442 #if no-changeset
1443 $ hg log -Gfr 'desc("mDGm-0")' d
1443 $ hg log -Gfr 'desc("mDGm-0")' d
1444 o 26 mDGm-0 simple merge - one way
1444 o 26 mDGm-0 simple merge - one way
1445 |\
1445 |\
1446 | o 25 g-1: update d
1446 | o 25 g-1: update d
1447 | |
1447 | |
1448 o | 8 d-2 re-add d
1448 o | 8 d-2 re-add d
1449 |/
1449 |/
1450 o 2 i-2: c -move-> d
1450 o 2 i-2: c -move-> d
1451 |
1451 |
1452 o 1 i-1: a -move-> c
1452 o 1 i-1: a -move-> c
1453 |
1453 |
1454 o 0 i-0 initial commit: a b h
1454 o 0 i-0 initial commit: a b h
1455
1455
1456 #else
1456 #else
1457 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1457 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1458 $ hg log -Gfr 'desc("mDGm-0")' d
1458 $ hg log -Gfr 'desc("mDGm-0")' d
1459 o 26 mDGm-0 simple merge - one way
1459 o 26 mDGm-0 simple merge - one way
1460 |\
1460 |\
1461 | o 25 g-1: update d
1461 | o 25 g-1: update d
1462 | |
1462 | |
1463 o | 8 d-2 re-add d
1463 o | 8 d-2 re-add d
1464 |/
1464 |/
1465 o 2 i-2: c -move-> d
1465 o 2 i-2: c -move-> d
1466 |
1466 |
1467 ~
1467 ~
1468 #endif
1468 #endif
1469
1469
1470
1470
1471 #if no-changeset
1471 #if no-changeset
1472 $ hg log -Gfr 'desc("mDGm-0")' d
1472 $ hg log -Gfr 'desc("mDGm-0")' d
1473 o 26 mDGm-0 simple merge - one way
1473 o 26 mDGm-0 simple merge - one way
1474 |\
1474 |\
1475 | o 25 g-1: update d
1475 | o 25 g-1: update d
1476 | |
1476 | |
1477 o | 8 d-2 re-add d
1477 o | 8 d-2 re-add d
1478 |/
1478 |/
1479 o 2 i-2: c -move-> d
1479 o 2 i-2: c -move-> d
1480 |
1480 |
1481 o 1 i-1: a -move-> c
1481 o 1 i-1: a -move-> c
1482 |
1482 |
1483 o 0 i-0 initial commit: a b h
1483 o 0 i-0 initial commit: a b h
1484
1484
1485 #else
1485 #else
1486 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1486 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1487 $ hg log -Gfr 'desc("mDGm-0")' d
1487 $ hg log -Gfr 'desc("mDGm-0")' d
1488 o 26 mDGm-0 simple merge - one way
1488 o 26 mDGm-0 simple merge - one way
1489 |\
1489 |\
1490 | o 25 g-1: update d
1490 | o 25 g-1: update d
1491 | |
1491 | |
1492 o | 8 d-2 re-add d
1492 o | 8 d-2 re-add d
1493 |/
1493 |/
1494 o 2 i-2: c -move-> d
1494 o 2 i-2: c -move-> d
1495 |
1495 |
1496 ~
1496 ~
1497 #endif
1497 #endif
1498
1498
1499
1499
1500 Merge:
1500 Merge:
1501 - one with change to a file (d)
1501 - one with change to a file (d)
1502 - one overwriting that file with a rename (from h to i, to d)
1502 - one overwriting that file with a rename (from h to i, to d)
1503
1503
1504 This case is similar to BF/FB, but an actual merge happens, so both side of the
1504 This case is similar to BF/FB, but an actual merge happens, so both side of the
1505 history are relevant.
1505 history are relevant.
1506
1506
1507
1507
1508 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
1508 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
1509 o 29 mGFm-0 simple merge - the other way
1509 o 29 mGFm-0 simple merge - the other way
1510 |\
1510 |\
1511 +---o 28 mFGm-0 simple merge - one way
1511 +---o 28 mFGm-0 simple merge - one way
1512 | |/
1512 | |/
1513 | o 25 g-1: update d
1513 | o 25 g-1: update d
1514 | |
1514 | |
1515 o | 22 f-2: rename i -> d
1515 o | 22 f-2: rename i -> d
1516 | |
1516 | |
1517 o | 21 f-1: rename h -> i
1517 o | 21 f-1: rename h -> i
1518 |/
1518 |/
1519 o 2 i-2: c -move-> d
1519 o 2 i-2: c -move-> d
1520 |
1520 |
1521 o 1 i-1: a -move-> c
1521 o 1 i-1: a -move-> c
1522 |
1522 |
1523 o 0 i-0 initial commit: a b h
1523 o 0 i-0 initial commit: a b h
1524
1524
1525
1525
1526 Note:
1526 Note:
1527 | In this case, the merge get conflicting information since on one side we have
1527 | In this case, the merge get conflicting information since on one side we have
1528 | "a -> c -> d". and one the other one we have "h -> i -> d".
1528 | "a -> c -> d". and one the other one we have "h -> i -> d".
1529 |
1529 |
1530 | The current code arbitrarily pick one side depending the ordering of the merged hash:
1530 | The current code arbitrarily pick one side depending the ordering of the merged hash:
1531
1531
1532 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"):
1532 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"):
1533
1533
1534 Details on this hash ordering pick:
1534 Details on this hash ordering pick:
1535
1535
1536 $ hg manifest --debug 'desc("g-1")' | egrep 'd$'
1536 $ hg manifest --debug 'desc("g-1")' | egrep 'd$'
1537 17ec97e605773eb44a117d1136b3849bcdc1924f 644 d (no-changeset !)
1537 17ec97e605773eb44a117d1136b3849bcdc1924f 644 d (no-changeset !)
1538 5cce88bf349f7c742bb440f2c53f81db9c294279 644 d (changeset !)
1538 5cce88bf349f7c742bb440f2c53f81db9c294279 644 d (changeset !)
1539 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("g-1")' d
1539 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("g-1")' d
1540 A d
1540 A d
1541 a (no-changeset no-compatibility !)
1541 a (no-changeset no-compatibility !)
1542
1542
1543 $ hg manifest --debug 'desc("f-2")' | egrep 'd$'
1543 $ hg manifest --debug 'desc("f-2")' | egrep 'd$'
1544 7b79e2fe0c8924e0e598a82f048a7b024afa4d96 644 d (no-changeset !)
1544 7b79e2fe0c8924e0e598a82f048a7b024afa4d96 644 d (no-changeset !)
1545 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
1545 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
1546 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("f-2")' d
1546 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("f-2")' d
1547 A d
1547 A d
1548 h (no-changeset no-compatibility !)
1548 h (no-changeset no-compatibility !)
1549
1549
1550 Copy tracing data on the resulting merge:
1550 Copy tracing data on the resulting merge:
1551
1551
1552 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
1552 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
1553 A d
1553 A d
1554 h (no-filelog !)
1554 h (no-filelog !)
1555 a (filelog !)
1555 a (filelog !)
1556 R a
1556 R a
1557 R h
1557 R h
1558 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
1558 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
1559 A d
1559 A d
1560 a (no-changeset !)
1560 a (no-changeset !)
1561 h (changeset !)
1561 h (changeset !)
1562 R a
1562 R a
1563 R h
1563 R h
1564 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
1564 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
1565 M d
1565 M d
1566 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
1566 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
1567 M d
1567 M d
1568 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
1568 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
1569 M d
1569 M d
1570 i (no-filelog !)
1570 i (no-filelog !)
1571 R i
1571 R i
1572 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
1572 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
1573 M d
1573 M d
1574 i (no-filelog !)
1574 i (no-filelog !)
1575 R i
1575 R i
1576 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
1576 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
1577 M d (no-changeset !)
1577 M d (no-changeset !)
1578 h (no-filelog no-changeset !)
1578 h (no-filelog no-changeset !)
1579 R h
1579 R h
1580 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
1580 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
1581 M d (no-changeset !)
1581 M d (no-changeset !)
1582 h (no-filelog no-changeset !)
1582 h (no-filelog no-changeset !)
1583 R h
1583 R h
1584
1584
1585 #if no-changeset
1585 #if no-changeset
1586 $ hg log -Gfr 'desc("mFGm-0")' d
1586 $ hg log -Gfr 'desc("mFGm-0")' d
1587 o 28 mFGm-0 simple merge - one way
1587 o 28 mFGm-0 simple merge - one way
1588 |\
1588 |\
1589 | o 25 g-1: update d
1589 | o 25 g-1: update d
1590 | |
1590 | |
1591 o | 22 f-2: rename i -> d
1591 o | 22 f-2: rename i -> d
1592 | |
1592 | |
1593 o | 21 f-1: rename h -> i
1593 o | 21 f-1: rename h -> i
1594 |/
1594 |/
1595 o 2 i-2: c -move-> d
1595 o 2 i-2: c -move-> d
1596 |
1596 |
1597 o 1 i-1: a -move-> c
1597 o 1 i-1: a -move-> c
1598 |
1598 |
1599 o 0 i-0 initial commit: a b h
1599 o 0 i-0 initial commit: a b h
1600
1600
1601 #else
1601 #else
1602 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1602 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1603 $ hg log -Gfr 'desc("mFGm-0")' d
1603 $ hg log -Gfr 'desc("mFGm-0")' d
1604 o 25 g-1: update d
1604 o 25 g-1: update d
1605 |
1605 |
1606 o 2 i-2: c -move-> d
1606 o 2 i-2: c -move-> d
1607 |
1607 |
1608 ~
1608 ~
1609 #endif
1609 #endif
1610
1610
1611 #if no-changeset
1611 #if no-changeset
1612 $ hg log -Gfr 'desc("mGFm-0")' d
1612 $ hg log -Gfr 'desc("mGFm-0")' d
1613 o 29 mGFm-0 simple merge - the other way
1613 o 29 mGFm-0 simple merge - the other way
1614 |\
1614 |\
1615 | o 25 g-1: update d
1615 | o 25 g-1: update d
1616 | |
1616 | |
1617 o | 22 f-2: rename i -> d
1617 o | 22 f-2: rename i -> d
1618 | |
1618 | |
1619 o | 21 f-1: rename h -> i
1619 o | 21 f-1: rename h -> i
1620 |/
1620 |/
1621 o 2 i-2: c -move-> d
1621 o 2 i-2: c -move-> d
1622 |
1622 |
1623 o 1 i-1: a -move-> c
1623 o 1 i-1: a -move-> c
1624 |
1624 |
1625 o 0 i-0 initial commit: a b h
1625 o 0 i-0 initial commit: a b h
1626
1626
1627 #else
1627 #else
1628 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1628 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1629 $ hg log -Gfr 'desc("mGFm-0")' d
1629 $ hg log -Gfr 'desc("mGFm-0")' d
1630 o 25 g-1: update d
1630 o 25 g-1: update d
1631 |
1631 |
1632 o 2 i-2: c -move-> d
1632 o 2 i-2: c -move-> d
1633 |
1633 |
1634 ~
1634 ~
1635 #endif
1635 #endif
1636
1636
1637
1637
1638 Comparing with merging with a deletion (and keeping the file)
1638 Comparing with merging with a deletion (and keeping the file)
1639 -------------------------------------------------------------
1639 -------------------------------------------------------------
1640
1640
1641 Merge:
1641 Merge:
1642 - one removing a file (d)
1642 - one removing a file (d)
1643 - one updating that file
1643 - one updating that file
1644 - the merge keep the modified version of the file (canceling the delete)
1644 - the merge keep the modified version of the file (canceling the delete)
1645
1645
1646 In this case, the file keep on living after the merge. So we should not drop its
1646 In this case, the file keep on living after the merge. So we should not drop its
1647 copy tracing chain.
1647 copy tracing chain.
1648
1648
1649 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
1649 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
1650 o 31 mGCm-0
1650 o 31 mGCm-0
1651 |\
1651 |\
1652 +---o 30 mCGm-0
1652 +---o 30 mCGm-0
1653 | |/
1653 | |/
1654 | o 25 g-1: update d
1654 | o 25 g-1: update d
1655 | |
1655 | |
1656 o | 6 c-1 delete d
1656 o | 6 c-1 delete d
1657 |/
1657 |/
1658 o 2 i-2: c -move-> d
1658 o 2 i-2: c -move-> d
1659 |
1659 |
1660 o 1 i-1: a -move-> c
1660 o 1 i-1: a -move-> c
1661 |
1661 |
1662 o 0 i-0 initial commit: a b h
1662 o 0 i-0 initial commit: a b h
1663
1663
1664
1664
1665 'a' is the copy source of 'd'
1665 'a' is the copy source of 'd'
1666
1666
1667 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")'
1667 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")'
1668 A d
1668 A d
1669 a (no-compatibility no-changeset !)
1669 a (no-compatibility no-changeset !)
1670 R a
1670 R a
1671 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")'
1671 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")'
1672 A d
1672 A d
1673 a (no-compatibility no-changeset !)
1673 a (no-compatibility no-changeset !)
1674 R a
1674 R a
1675 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")'
1675 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")'
1676 A d
1676 A d
1677 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")'
1677 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")'
1678 A d
1678 A d
1679 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")'
1679 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")'
1680 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")'
1680 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")'
1681
1681
1682
1682
1683 Comparing with merge restoring an untouched deleted file
1683 Comparing with merge restoring an untouched deleted file
1684 --------------------------------------------------------
1684 --------------------------------------------------------
1685
1685
1686 Merge:
1686 Merge:
1687 - one removing a file (d)
1687 - one removing a file (d)
1688 - one leaving the file untouched
1688 - one leaving the file untouched
1689 - the merge actively restore the file to the same content.
1689 - the merge actively restore the file to the same content.
1690
1690
1691 In this case, the file keep on living after the merge. So we should not drop its
1691 In this case, the file keep on living after the merge. So we should not drop its
1692 copy tracing chain.
1692 copy tracing chain.
1693
1693
1694 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
1694 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
1695 o 33 mBC-revert-m-0
1695 o 33 mBC-revert-m-0
1696 |\
1696 |\
1697 +---o 32 mCB-revert-m-0
1697 +---o 32 mCB-revert-m-0
1698 | |/
1698 | |/
1699 | o 6 c-1 delete d
1699 | o 6 c-1 delete d
1700 | |
1700 | |
1701 o | 5 b-1: b update
1701 o | 5 b-1: b update
1702 |/
1702 |/
1703 o 2 i-2: c -move-> d
1703 o 2 i-2: c -move-> d
1704 |
1704 |
1705 o 1 i-1: a -move-> c
1705 o 1 i-1: a -move-> c
1706 |
1706 |
1707 o 0 i-0 initial commit: a b h
1707 o 0 i-0 initial commit: a b h
1708
1708
1709
1709
1710 'a' is the the copy source of 'd'
1710 'a' is the the copy source of 'd'
1711
1711
1712 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
1712 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
1713 M b
1713 M b
1714 A d
1714 A d
1715 a (no-compatibility no-changeset !)
1715 a (no-compatibility no-changeset !)
1716 R a
1716 R a
1717 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
1717 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
1718 M b
1718 M b
1719 A d
1719 A d
1720 a (no-compatibility no-changeset !)
1720 a (no-compatibility no-changeset !)
1721 R a
1721 R a
1722 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")'
1722 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")'
1723 M b
1723 M b
1724 A d
1724 A d
1725 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")'
1725 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")'
1726 M b
1726 M b
1727 A d
1727 A d
1728 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")'
1728 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")'
1729 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")'
1729 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")'
1730
1730
1731
1731
1732 Merging a branch where a rename was deleted with a branch where the same file was renamed
1732 Merging a branch where a rename was deleted with a branch where the same file was renamed
1733 ------------------------------------------------------------------------------------------
1733 ------------------------------------------------------------------------------------------
1734
1734
1735 Create a "conflicting" merge where `d` get removed on one branch before its
1735 Create a "conflicting" merge where `d` get removed on one branch before its
1736 rename information actually conflict with the other branch.
1736 rename information actually conflict with the other branch.
1737
1737
1738 (the copy information from the branch that was not deleted should win).
1738 (the copy information from the branch that was not deleted should win).
1739
1739
1740 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
1740 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
1741 o 36 mHC-delete-before-conflict-m-0
1741 o 36 mHC-delete-before-conflict-m-0
1742 |\
1742 |\
1743 +---o 35 mCH-delete-before-conflict-m-0
1743 +---o 35 mCH-delete-before-conflict-m-0
1744 | |/
1744 | |/
1745 | o 34 h-1: b -(move)-> d
1745 | o 34 h-1: b -(move)-> d
1746 | |
1746 | |
1747 o | 6 c-1 delete d
1747 o | 6 c-1 delete d
1748 | |
1748 | |
1749 o | 2 i-2: c -move-> d
1749 o | 2 i-2: c -move-> d
1750 | |
1750 | |
1751 o | 1 i-1: a -move-> c
1751 o | 1 i-1: a -move-> c
1752 |/
1752 |/
1753 o 0 i-0 initial commit: a b h
1753 o 0 i-0 initial commit: a b h
1754
1754
1755
1755
1756 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCH-delete-before-conflict-m")'
1756 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCH-delete-before-conflict-m")'
1757 A d
1757 A d
1758 b (no-compatibility no-changeset !)
1758 b (no-compatibility no-changeset !)
1759 R a
1759 R a
1760 R b
1760 R b
1761 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mHC-delete-before-conflict-m")'
1761 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mHC-delete-before-conflict-m")'
1762 A d
1762 A d
1763 b
1763 b
1764 R a
1764 R a
1765 R b
1765 R b
1766 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1766 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1767 A d
1767 A d
1768 b
1768 b
1769 R b
1769 R b
1770 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1770 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1771 A d
1771 A d
1772 b
1772 b
1773 R b
1773 R b
1774 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1774 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1775 R a
1775 R a
1776 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1776 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1777 R a
1777 R a
General Comments 0
You need to be logged in to leave comments. Login now