##// END OF EJS Templates
test-copies: improve description of the B+F case...
marmoute -
r47292:f8888f5c default
parent child Browse files
Show More
@@ -1,1783 +1,1783 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 - A side: multiple renames, B side: unrelated update"
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 - A side: multiple renames, B side: unrelated update - 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 - A side: multiple renames, B side: unrelated update - 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 - C side: delete a file with copies history , B side: unrelated update"
230 $ case_desc="simple merge - C side: delete a file with copies history , B side: unrelated update"
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 - C side: delete a file with copies history , B side: unrelated update - the other way
254 o 15 mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - 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 - C side: delete a file with copies history , B side: unrelated update - one way
258 +---o 13 mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - 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 - B side: unrelated update, D side: delete and recreate a file (with different content)"
278 $ case_desc="simple merge - B side: unrelated update, D side: delete and recreate a file (with different content)"
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 - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
294 @ 18 mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
295 |\
295 |\
296 +---o 17 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
296 +---o 17 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - 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="merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f)"
318 $ case_desc="merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f)"
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 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
337 @ 20 mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
338 |\
338 |\
339 +---o 19 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
339 +---o 19 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
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 - B side: unrelated change, F side: overwrite d with a copy (from h->i->d)"
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 - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
393 |\
393 |\
394 +---o 23 mBFm-0 simple merge - one way
394 +---o 23 mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - 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="actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content"
417 $ case_desc="actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content"
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 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
441 @ 27 mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
442 |\
442 |\
443 +---o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
443 +---o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - 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="merge - G side: content change, F side: copy overwrite, no content change"
472 $ case_desc="merge - G side: content change, F side: copy overwrite, no content change"
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 merge - G side: content change, F side: copy overwrite, no content change - the other way
494 @ 29 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
495 |\
495 |\
496 +---o 28 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
496 +---o 28 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - 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 $ case_desc="merge updated/deleted - revive the file (updated content)"
523 $ case_desc="merge updated/deleted - revive the file (updated content)"
524
524
525 $ hg up 'desc("c-1")'
525 $ hg up 'desc("c-1")'
526 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
526 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
527 $ hg merge 'desc("g-1")'
527 $ hg merge 'desc("g-1")'
528 file 'd' was deleted in local [working copy] but was modified in other [merge rev].
528 file 'd' was deleted in local [working copy] but was modified in other [merge rev].
529 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
529 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
530 What do you want to do? u
530 What do you want to do? u
531 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
531 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
532 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
532 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
533 [1]
533 [1]
534 $ hg resolve -t :other d
534 $ hg resolve -t :other d
535 (no more unresolved files)
535 (no more unresolved files)
536 $ hg ci -m "mCGm-0 $case_desc - one way"
536 $ hg ci -m "mCGm-0 $case_desc - one way"
537 created new head
537 created new head
538
538
539 $ hg up 'desc("g-1")'
539 $ hg up 'desc("g-1")'
540 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
540 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
541 $ hg merge 'desc("c-1")'
541 $ hg merge 'desc("c-1")'
542 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
542 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
543 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
543 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
544 What do you want to do? u
544 What do you want to do? u
545 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
545 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
546 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
546 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
547 [1]
547 [1]
548 $ hg resolve -t :local d
548 $ hg resolve -t :local d
549 (no more unresolved files)
549 (no more unresolved files)
550 $ hg ci -m "mGCm-0 $case_desc - the other way"
550 $ hg ci -m "mGCm-0 $case_desc - the other way"
551 created new head
551 created new head
552
552
553 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
553 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
554 @ 31 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
554 @ 31 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
555 |\
555 |\
556 +---o 30 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
556 +---o 30 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
557 | |/
557 | |/
558 | o 25 g-1: update d
558 | o 25 g-1: update d
559 | |
559 | |
560 o | 6 c-1 delete d
560 o | 6 c-1 delete d
561 |/
561 |/
562 o 2 i-2: c -move-> d
562 o 2 i-2: c -move-> d
563 |
563 |
564 o 1 i-1: a -move-> c
564 o 1 i-1: a -move-> c
565 |
565 |
566 o 0 i-0 initial commit: a b h
566 o 0 i-0 initial commit: a b h
567
567
568
568
569
569
570
570
571 Comparing with merge restoring an untouched deleted file
571 Comparing with merge restoring an untouched deleted file
572 --------------------------------------------------------
572 --------------------------------------------------------
573
573
574 Merge:
574 Merge:
575 - one removing a file (d)
575 - one removing a file (d)
576 - one leaving the file untouched
576 - one leaving the file untouched
577 - the merge actively restore the file to the same content.
577 - the merge actively restore the file to the same content.
578
578
579 In this case, the file keep on living after the merge. So we should not drop its
579 In this case, the file keep on living after the merge. So we should not drop its
580 copy tracing chain.
580 copy tracing chain.
581
581
582 $ case_desc="merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge)"
582 $ case_desc="merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge)"
583
583
584 $ hg up 'desc("c-1")'
584 $ hg up 'desc("c-1")'
585 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
585 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
586 $ hg merge 'desc("b-1")'
586 $ hg merge 'desc("b-1")'
587 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
587 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
588 (branch merge, don't forget to commit)
588 (branch merge, don't forget to commit)
589 $ hg revert --rev 'desc("b-1")' d
589 $ hg revert --rev 'desc("b-1")' d
590 $ hg ci -m "mCB-revert-m-0 $case_desc - one way"
590 $ hg ci -m "mCB-revert-m-0 $case_desc - one way"
591 created new head
591 created new head
592
592
593 $ hg up 'desc("b-1")'
593 $ hg up 'desc("b-1")'
594 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
594 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
595 $ hg merge 'desc("c-1")'
595 $ hg merge 'desc("c-1")'
596 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
596 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
597 (branch merge, don't forget to commit)
597 (branch merge, don't forget to commit)
598 $ hg revert --rev 'desc("b-1")' d
598 $ hg revert --rev 'desc("b-1")' d
599 $ hg ci -m "mBC-revert-m-0 $case_desc - the other way"
599 $ hg ci -m "mBC-revert-m-0 $case_desc - the other way"
600 created new head
600 created new head
601
601
602 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
602 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
603 @ 33 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
603 @ 33 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
604 |\
604 |\
605 +---o 32 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
605 +---o 32 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
606 | |/
606 | |/
607 | o 6 c-1 delete d
607 | o 6 c-1 delete d
608 | |
608 | |
609 o | 5 b-1: b update
609 o | 5 b-1: b update
610 |/
610 |/
611 o 2 i-2: c -move-> d
611 o 2 i-2: c -move-> d
612 |
612 |
613 o 1 i-1: a -move-> c
613 o 1 i-1: a -move-> c
614 |
614 |
615 o 0 i-0 initial commit: a b h
615 o 0 i-0 initial commit: a b h
616
616
617
617
618
618
619 $ hg up null --quiet
619 $ hg up null --quiet
620
620
621 Merging a branch where a rename was deleted with a branch where the same file was renamed
621 Merging a branch where a rename was deleted with a branch where the same file was renamed
622 ------------------------------------------------------------------------------------------
622 ------------------------------------------------------------------------------------------
623
623
624 Create a "conflicting" merge where `d` get removed on one branch before its
624 Create a "conflicting" merge where `d` get removed on one branch before its
625 rename information actually conflict with the other branch.
625 rename information actually conflict with the other branch.
626
626
627 (the copy information from the branch that was not deleted should win).
627 (the copy information from the branch that was not deleted should win).
628
628
629 $ case_desc="simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch)"
629 $ case_desc="simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch)"
630
630
631 $ hg up 'desc("i-0")'
631 $ hg up 'desc("i-0")'
632 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
632 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
633 $ hg mv b d
633 $ hg mv b d
634 $ hg ci -m "h-1: b -(move)-> d"
634 $ hg ci -m "h-1: b -(move)-> d"
635 created new head
635 created new head
636
636
637 $ hg up 'desc("c-1")'
637 $ hg up 'desc("c-1")'
638 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
638 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
639 $ hg merge 'desc("h-1")'
639 $ hg merge 'desc("h-1")'
640 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
640 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
641 (branch merge, don't forget to commit)
641 (branch merge, don't forget to commit)
642 $ hg ci -m "mCH-delete-before-conflict-m-0 $case_desc - one way"
642 $ hg ci -m "mCH-delete-before-conflict-m-0 $case_desc - one way"
643
643
644 $ hg up 'desc("h-1")'
644 $ hg up 'desc("h-1")'
645 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
645 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
646 $ hg merge 'desc("c-1")'
646 $ hg merge 'desc("c-1")'
647 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
647 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
648 (branch merge, don't forget to commit)
648 (branch merge, don't forget to commit)
649 $ hg ci -m "mHC-delete-before-conflict-m-0 $case_desc - the other way"
649 $ hg ci -m "mHC-delete-before-conflict-m-0 $case_desc - the other way"
650 created new head
650 created new head
651 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
651 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
652 @ 36 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
652 @ 36 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
653 |\
653 |\
654 +---o 35 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
654 +---o 35 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
655 | |/
655 | |/
656 | o 34 h-1: b -(move)-> d
656 | o 34 h-1: b -(move)-> d
657 | |
657 | |
658 o | 6 c-1 delete d
658 o | 6 c-1 delete d
659 | |
659 | |
660 o | 2 i-2: c -move-> d
660 o | 2 i-2: c -move-> d
661 | |
661 | |
662 o | 1 i-1: a -move-> c
662 o | 1 i-1: a -move-> c
663 |/
663 |/
664 o 0 i-0 initial commit: a b h
664 o 0 i-0 initial commit: a b h
665
665
666
666
667
667
668 Summary of all created cases
668 Summary of all created cases
669 ----------------------------
669 ----------------------------
670
670
671 $ hg up --quiet null
671 $ hg up --quiet null
672
672
673 (This exists to help keeping a compact list of the various cases we have built)
673 (This exists to help keeping a compact list of the various cases we have built)
674
674
675 $ hg log -T '{desc|firstline}\n'| sort
675 $ hg log -T '{desc|firstline}\n'| sort
676 a-1: d -move-> e
676 a-1: d -move-> e
677 a-2: e -move-> f
677 a-2: e -move-> f
678 b-1: b update
678 b-1: b update
679 c-1 delete d
679 c-1 delete d
680 d-1 delete d
680 d-1 delete d
681 d-2 re-add d
681 d-2 re-add d
682 e-1 b -move-> g
682 e-1 b -move-> g
683 e-2 g -move-> f
683 e-2 g -move-> f
684 f-1: rename h -> i
684 f-1: rename h -> i
685 f-2: rename i -> d
685 f-2: rename i -> d
686 g-1: update d
686 g-1: update d
687 h-1: b -(move)-> d
687 h-1: b -(move)-> d
688 i-0 initial commit: a b h
688 i-0 initial commit: a b h
689 i-1: a -move-> c
689 i-1: a -move-> c
690 i-2: c -move-> d
690 i-2: c -move-> d
691 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
691 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
692 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
692 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
693 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
693 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
694 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
694 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
695 mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
695 mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
696 mBCm-1 re-add d
696 mBCm-1 re-add d
697 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
697 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
698 mBFm-0 simple merge - one way
698 mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
699 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
699 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
700 mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
700 mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
701 mCBm-1 re-add d
701 mCBm-1 re-add d
702 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
702 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
703 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
703 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
704 mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
704 mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
705 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
705 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
706 mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
706 mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
707 mFBm-0 simple merge - the other way
707 mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
708 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
708 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
709 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
709 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
710 mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
710 mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
711 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
711 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
712 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
712 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
713
713
714
714
715 Test that sidedata computations during upgrades are correct
715 Test that sidedata computations during upgrades are correct
716 ===========================================================
716 ===========================================================
717
717
718 We upgrade a repository that is not using sidedata (the filelog case) and
718 We upgrade a repository that is not using sidedata (the filelog case) and
719 check that the same side data have been generated as if they were computed at
719 check that the same side data have been generated as if they were computed at
720 commit time.
720 commit time.
721
721
722
722
723 #if upgraded
723 #if upgraded
724 $ cat >> $HGRCPATH << EOF
724 $ cat >> $HGRCPATH << EOF
725 > [format]
725 > [format]
726 > exp-use-side-data = yes
726 > exp-use-side-data = yes
727 > exp-use-copies-side-data-changeset = yes
727 > exp-use-copies-side-data-changeset = yes
728 > EOF
728 > EOF
729 $ hg debugformat -v
729 $ hg debugformat -v
730 format-variant repo config default
730 format-variant repo config default
731 fncache: yes yes yes
731 fncache: yes yes yes
732 dotencode: yes yes yes
732 dotencode: yes yes yes
733 generaldelta: yes yes yes
733 generaldelta: yes yes yes
734 share-safe: no no no
734 share-safe: no no no
735 sparserevlog: yes yes yes
735 sparserevlog: yes yes yes
736 sidedata: no yes no
736 sidedata: no yes no
737 persistent-nodemap: no no no
737 persistent-nodemap: no no no
738 copies-sdc: no yes no
738 copies-sdc: no yes no
739 plain-cl-delta: yes yes yes
739 plain-cl-delta: yes yes yes
740 compression: * (glob)
740 compression: * (glob)
741 compression-level: default default default
741 compression-level: default default default
742 $ hg debugupgraderepo --run --quiet
742 $ hg debugupgraderepo --run --quiet
743 upgrade will perform the following actions:
743 upgrade will perform the following actions:
744
744
745 requirements
745 requirements
746 preserved: * (glob)
746 preserved: * (glob)
747 added: exp-copies-sidedata-changeset, exp-sidedata-flag
747 added: exp-copies-sidedata-changeset, exp-sidedata-flag
748
748
749 processed revlogs:
749 processed revlogs:
750 - all-filelogs
750 - all-filelogs
751 - changelog
751 - changelog
752 - manifest
752 - manifest
753
753
754 #endif
754 #endif
755
755
756
756
757 #if no-compatibility no-filelog no-changeset
757 #if no-compatibility no-filelog no-changeset
758
758
759 $ hg debugchangedfiles --compute 0
759 $ hg debugchangedfiles --compute 0
760 added : a, ;
760 added : a, ;
761 added : b, ;
761 added : b, ;
762 added : h, ;
762 added : h, ;
763
763
764 $ for rev in `hg log --rev 'all()' -T '{rev}\n'`; do
764 $ for rev in `hg log --rev 'all()' -T '{rev}\n'`; do
765 > echo "##### revision $rev #####"
765 > echo "##### revision $rev #####"
766 > hg debugsidedata -c -v -- $rev
766 > hg debugsidedata -c -v -- $rev
767 > hg debugchangedfiles $rev
767 > hg debugchangedfiles $rev
768 > done
768 > done
769 ##### revision 0 #####
769 ##### revision 0 #####
770 1 sidedata entries
770 1 sidedata entries
771 entry-0014 size 34
771 entry-0014 size 34
772 '\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'
772 '\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'
773 added : a, ;
773 added : a, ;
774 added : b, ;
774 added : b, ;
775 added : h, ;
775 added : h, ;
776 ##### revision 1 #####
776 ##### revision 1 #####
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\x00ac'
779 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ac'
780 removed : a, ;
780 removed : a, ;
781 added p1: c, a;
781 added p1: c, a;
782 ##### revision 2 #####
782 ##### revision 2 #####
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\x00cd'
785 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00cd'
786 removed : c, ;
786 removed : c, ;
787 added p1: d, c;
787 added p1: d, c;
788 ##### revision 3 #####
788 ##### revision 3 #####
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\x00de'
791 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00de'
792 removed : d, ;
792 removed : d, ;
793 added p1: e, d;
793 added p1: e, d;
794 ##### revision 4 #####
794 ##### revision 4 #####
795 1 sidedata entries
795 1 sidedata entries
796 entry-0014 size 24
796 entry-0014 size 24
797 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ef'
797 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ef'
798 removed : e, ;
798 removed : e, ;
799 added p1: f, e;
799 added p1: f, e;
800 ##### revision 5 #####
800 ##### revision 5 #####
801 1 sidedata entries
801 1 sidedata entries
802 entry-0014 size 14
802 entry-0014 size 14
803 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00b'
803 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00b'
804 touched : b, ;
804 touched : b, ;
805 ##### revision 6 #####
805 ##### revision 6 #####
806 1 sidedata entries
806 1 sidedata entries
807 entry-0014 size 14
807 entry-0014 size 14
808 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
808 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
809 removed : d, ;
809 removed : d, ;
810 ##### revision 7 #####
810 ##### revision 7 #####
811 1 sidedata entries
811 1 sidedata entries
812 entry-0014 size 14
812 entry-0014 size 14
813 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
813 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
814 removed : d, ;
814 removed : d, ;
815 ##### revision 8 #####
815 ##### revision 8 #####
816 1 sidedata entries
816 1 sidedata entries
817 entry-0014 size 14
817 entry-0014 size 14
818 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
818 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
819 added : d, ;
819 added : d, ;
820 ##### revision 9 #####
820 ##### revision 9 #####
821 1 sidedata entries
821 1 sidedata entries
822 entry-0014 size 24
822 entry-0014 size 24
823 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bg'
823 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bg'
824 removed : b, ;
824 removed : b, ;
825 added p1: g, b;
825 added p1: g, b;
826 ##### revision 10 #####
826 ##### revision 10 #####
827 1 sidedata entries
827 1 sidedata entries
828 entry-0014 size 24
828 entry-0014 size 24
829 '\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00fg'
829 '\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00fg'
830 added p1: f, g;
830 added p1: f, g;
831 removed : g, ;
831 removed : g, ;
832 ##### revision 11 #####
832 ##### revision 11 #####
833 1 sidedata entries
833 1 sidedata entries
834 entry-0014 size 4
834 entry-0014 size 4
835 '\x00\x00\x00\x00'
835 '\x00\x00\x00\x00'
836 ##### revision 12 #####
836 ##### revision 12 #####
837 1 sidedata entries
837 1 sidedata entries
838 entry-0014 size 4
838 entry-0014 size 4
839 '\x00\x00\x00\x00'
839 '\x00\x00\x00\x00'
840 ##### revision 13 #####
840 ##### revision 13 #####
841 1 sidedata entries
841 1 sidedata entries
842 entry-0014 size 4
842 entry-0014 size 4
843 '\x00\x00\x00\x00'
843 '\x00\x00\x00\x00'
844 ##### revision 14 #####
844 ##### revision 14 #####
845 1 sidedata entries
845 1 sidedata entries
846 entry-0014 size 14
846 entry-0014 size 14
847 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
847 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
848 added : d, ;
848 added : d, ;
849 ##### revision 15 #####
849 ##### revision 15 #####
850 1 sidedata entries
850 1 sidedata entries
851 entry-0014 size 4
851 entry-0014 size 4
852 '\x00\x00\x00\x00'
852 '\x00\x00\x00\x00'
853 ##### revision 16 #####
853 ##### revision 16 #####
854 1 sidedata entries
854 1 sidedata entries
855 entry-0014 size 14
855 entry-0014 size 14
856 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
856 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
857 added : d, ;
857 added : d, ;
858 ##### revision 17 #####
858 ##### revision 17 #####
859 1 sidedata entries
859 1 sidedata entries
860 entry-0014 size 4
860 entry-0014 size 4
861 '\x00\x00\x00\x00'
861 '\x00\x00\x00\x00'
862 ##### revision 18 #####
862 ##### revision 18 #####
863 1 sidedata entries
863 1 sidedata entries
864 entry-0014 size 4
864 entry-0014 size 4
865 '\x00\x00\x00\x00'
865 '\x00\x00\x00\x00'
866 ##### revision 19 #####
866 ##### revision 19 #####
867 1 sidedata entries
867 1 sidedata entries
868 entry-0014 size 14
868 entry-0014 size 14
869 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
869 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
870 merged : f, ;
870 merged : f, ;
871 ##### revision 20 #####
871 ##### revision 20 #####
872 1 sidedata entries
872 1 sidedata entries
873 entry-0014 size 14
873 entry-0014 size 14
874 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
874 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
875 merged : f, ;
875 merged : f, ;
876 ##### revision 21 #####
876 ##### revision 21 #####
877 1 sidedata entries
877 1 sidedata entries
878 entry-0014 size 24
878 entry-0014 size 24
879 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00hi'
879 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00hi'
880 removed : h, ;
880 removed : h, ;
881 added p1: i, h;
881 added p1: i, h;
882 ##### revision 22 #####
882 ##### revision 22 #####
883 1 sidedata entries
883 1 sidedata entries
884 entry-0014 size 24
884 entry-0014 size 24
885 '\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00di'
885 '\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00di'
886 touched p1: d, i;
886 touched p1: d, i;
887 removed : i, ;
887 removed : i, ;
888 ##### revision 23 #####
888 ##### revision 23 #####
889 1 sidedata entries
889 1 sidedata entries
890 entry-0014 size 4
890 entry-0014 size 4
891 '\x00\x00\x00\x00'
891 '\x00\x00\x00\x00'
892 ##### revision 24 #####
892 ##### revision 24 #####
893 1 sidedata entries
893 1 sidedata entries
894 entry-0014 size 4
894 entry-0014 size 4
895 '\x00\x00\x00\x00'
895 '\x00\x00\x00\x00'
896 ##### revision 25 #####
896 ##### revision 25 #####
897 1 sidedata entries
897 1 sidedata entries
898 entry-0014 size 14
898 entry-0014 size 14
899 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
899 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
900 touched : d, ;
900 touched : d, ;
901 ##### revision 26 #####
901 ##### revision 26 #####
902 1 sidedata entries
902 1 sidedata entries
903 entry-0014 size 14
903 entry-0014 size 14
904 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
904 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
905 merged : d, ;
905 merged : d, ;
906 ##### revision 27 #####
906 ##### revision 27 #####
907 1 sidedata entries
907 1 sidedata entries
908 entry-0014 size 14
908 entry-0014 size 14
909 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
909 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
910 merged : d, ;
910 merged : d, ;
911 ##### revision 28 #####
911 ##### revision 28 #####
912 1 sidedata entries
912 1 sidedata entries
913 entry-0014 size 14
913 entry-0014 size 14
914 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
914 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
915 merged : d, ;
915 merged : d, ;
916 ##### revision 29 #####
916 ##### revision 29 #####
917 1 sidedata entries
917 1 sidedata entries
918 entry-0014 size 14
918 entry-0014 size 14
919 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
919 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
920 merged : d, ;
920 merged : d, ;
921 ##### revision 30 #####
921 ##### revision 30 #####
922 1 sidedata entries
922 1 sidedata entries
923 entry-0014 size 14
923 entry-0014 size 14
924 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
924 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
925 salvaged : d, ;
925 salvaged : d, ;
926 ##### revision 31 #####
926 ##### revision 31 #####
927 1 sidedata entries
927 1 sidedata entries
928 entry-0014 size 14
928 entry-0014 size 14
929 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
929 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
930 salvaged : d, ;
930 salvaged : d, ;
931 ##### revision 32 #####
931 ##### revision 32 #####
932 1 sidedata entries
932 1 sidedata entries
933 entry-0014 size 14
933 entry-0014 size 14
934 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
934 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
935 salvaged : d, ;
935 salvaged : d, ;
936 ##### revision 33 #####
936 ##### revision 33 #####
937 1 sidedata entries
937 1 sidedata entries
938 entry-0014 size 14
938 entry-0014 size 14
939 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
939 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
940 salvaged : d, ;
940 salvaged : d, ;
941 ##### revision 34 #####
941 ##### revision 34 #####
942 1 sidedata entries
942 1 sidedata entries
943 entry-0014 size 24
943 entry-0014 size 24
944 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bd'
944 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bd'
945 removed : b, ;
945 removed : b, ;
946 added p1: d, b;
946 added p1: d, b;
947 ##### revision 35 #####
947 ##### revision 35 #####
948 1 sidedata entries
948 1 sidedata entries
949 entry-0014 size 4
949 entry-0014 size 4
950 '\x00\x00\x00\x00'
950 '\x00\x00\x00\x00'
951 ##### revision 36 #####
951 ##### revision 36 #####
952 1 sidedata entries
952 1 sidedata entries
953 entry-0014 size 4
953 entry-0014 size 4
954 '\x00\x00\x00\x00'
954 '\x00\x00\x00\x00'
955
955
956 #endif
956 #endif
957
957
958
958
959 Test copy information chaining
959 Test copy information chaining
960 ==============================
960 ==============================
961
961
962 Check that matching only affect the destination and not intermediate path
962 Check that matching only affect the destination and not intermediate path
963 -------------------------------------------------------------------------
963 -------------------------------------------------------------------------
964
964
965 The two status call should give the same value for f
965 The two status call should give the same value for f
966
966
967 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")'
967 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")'
968 A f
968 A f
969 a
969 a
970 R a
970 R a
971 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")' f
971 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")' f
972 A f
972 A f
973 a (no-changeset no-compatibility !)
973 a (no-changeset no-compatibility !)
974
974
975 merging with unrelated change does not interfere with the renames
975 merging with unrelated change does not interfere with the renames
976 ---------------------------------------------------------------
976 ---------------------------------------------------------------
977
977
978 - rename on one side
978 - rename on one side
979 - unrelated change on the other side
979 - unrelated change on the other side
980
980
981 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
981 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
982 o 12 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
982 o 12 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
983 |\
983 |\
984 +---o 11 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
984 +---o 11 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
985 | |/
985 | |/
986 | o 5 b-1: b update
986 | o 5 b-1: b update
987 | |
987 | |
988 o | 4 a-2: e -move-> f
988 o | 4 a-2: e -move-> f
989 | |
989 | |
990 o | 3 a-1: d -move-> e
990 o | 3 a-1: d -move-> e
991 |/
991 |/
992 o 2 i-2: c -move-> d
992 o 2 i-2: c -move-> d
993 |
993 |
994 o 1 i-1: a -move-> c
994 o 1 i-1: a -move-> c
995 |
995 |
996 o 0 i-0 initial commit: a b h
996 o 0 i-0 initial commit: a b h
997
997
998
998
999 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
999 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
1000 A f
1000 A f
1001 d
1001 d
1002 R d
1002 R d
1003 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
1003 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
1004 A f
1004 A f
1005 d
1005 d
1006 R d
1006 R d
1007 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
1007 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
1008 M b
1008 M b
1009 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
1009 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
1010 M b
1010 M b
1011 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
1011 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
1012 M b
1012 M b
1013 A f
1013 A f
1014 d
1014 d
1015 R d
1015 R d
1016 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
1016 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
1017 M b
1017 M b
1018 A f
1018 A f
1019 d
1019 d
1020 R d
1020 R d
1021 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
1021 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
1022 M b
1022 M b
1023 A f
1023 A f
1024 a
1024 a
1025 R a
1025 R a
1026 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
1026 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
1027 M b
1027 M b
1028 A f
1028 A f
1029 a
1029 a
1030 R a
1030 R a
1031
1031
1032 merging with the side having a delete
1032 merging with the side having a delete
1033 -------------------------------------
1033 -------------------------------------
1034
1034
1035 case summary:
1035 case summary:
1036 - one with change to an unrelated file
1036 - one with change to an unrelated file
1037 - one deleting the change
1037 - one deleting the change
1038 and recreate an unrelated file after the merge
1038 and recreate an unrelated file after the merge
1039
1039
1040 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
1040 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
1041 o 16 mCBm-1 re-add d
1041 o 16 mCBm-1 re-add d
1042 |
1042 |
1043 o 15 mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
1043 o 15 mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
1044 |\
1044 |\
1045 | | o 14 mBCm-1 re-add d
1045 | | o 14 mBCm-1 re-add d
1046 | | |
1046 | | |
1047 +---o 13 mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
1047 +---o 13 mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
1048 | |/
1048 | |/
1049 | o 6 c-1 delete d
1049 | o 6 c-1 delete d
1050 | |
1050 | |
1051 o | 5 b-1: b update
1051 o | 5 b-1: b update
1052 |/
1052 |/
1053 o 2 i-2: c -move-> d
1053 o 2 i-2: c -move-> d
1054 |
1054 |
1055 o 1 i-1: a -move-> c
1055 o 1 i-1: a -move-> c
1056 |
1056 |
1057 o 0 i-0 initial commit: a b h
1057 o 0 i-0 initial commit: a b h
1058
1058
1059 - comparing from the merge
1059 - comparing from the merge
1060
1060
1061 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
1061 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
1062 R d
1062 R d
1063 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
1063 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
1064 R d
1064 R d
1065 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
1065 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
1066 M b
1066 M b
1067 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
1067 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
1068 M b
1068 M b
1069 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
1069 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
1070 M b
1070 M b
1071 R d
1071 R d
1072 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
1072 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
1073 M b
1073 M b
1074 R d
1074 R d
1075 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
1075 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
1076 M b
1076 M b
1077 R a
1077 R a
1078 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
1078 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
1079 M b
1079 M b
1080 R a
1080 R a
1081
1081
1082 - comparing with the merge children re-adding the file
1082 - comparing with the merge children re-adding the file
1083
1083
1084 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
1084 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
1085 M d
1085 M d
1086 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
1086 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
1087 M d
1087 M d
1088 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
1088 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
1089 M b
1089 M b
1090 A d
1090 A d
1091 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
1091 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
1092 M b
1092 M b
1093 A d
1093 A d
1094 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
1094 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
1095 M b
1095 M b
1096 M d
1096 M d
1097 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
1097 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
1098 M b
1098 M b
1099 M d
1099 M d
1100 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
1100 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
1101 M b
1101 M b
1102 A d
1102 A d
1103 R a
1103 R a
1104 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
1104 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
1105 M b
1105 M b
1106 A d
1106 A d
1107 R a
1107 R a
1108
1108
1109 Comparing with a merge re-adding the file afterward
1109 Comparing with a merge re-adding the file afterward
1110 ---------------------------------------------------
1110 ---------------------------------------------------
1111
1111
1112 Merge:
1112 Merge:
1113 - one with change to an unrelated file
1113 - one with change to an unrelated file
1114 - one deleting and recreating the change
1114 - one deleting and recreating the change
1115
1115
1116 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
1116 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
1117 o 18 mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
1117 o 18 mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
1118 |\
1118 |\
1119 +---o 17 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
1119 +---o 17 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
1120 | |/
1120 | |/
1121 | o 8 d-2 re-add d
1121 | o 8 d-2 re-add d
1122 | |
1122 | |
1123 | o 7 d-1 delete d
1123 | o 7 d-1 delete d
1124 | |
1124 | |
1125 o | 5 b-1: b update
1125 o | 5 b-1: b update
1126 |/
1126 |/
1127 o 2 i-2: c -move-> d
1127 o 2 i-2: c -move-> d
1128 |
1128 |
1129 o 1 i-1: a -move-> c
1129 o 1 i-1: a -move-> c
1130 |
1130 |
1131 o 0 i-0 initial commit: a b h
1131 o 0 i-0 initial commit: a b h
1132
1132
1133 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
1133 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
1134 M d
1134 M d
1135 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
1135 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
1136 M d
1136 M d
1137 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
1137 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
1138 M b
1138 M b
1139 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
1139 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
1140 M b
1140 M b
1141 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
1141 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
1142 M b
1142 M b
1143 M d
1143 M d
1144 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
1144 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
1145 M b
1145 M b
1146 M d
1146 M d
1147
1147
1148 The bugs makes recorded copy is different depending of where we started the merge from since
1148 The bugs makes recorded copy is different depending of where we started the merge from since
1149
1149
1150 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
1150 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
1151 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1151 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1152 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
1152 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
1153 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1153 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1154
1154
1155 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
1155 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
1156 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1156 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1157 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
1157 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
1158 d8252ab2e760b0d4e5288fd44cbd15a0fa567e16 644 d (no-changeset !)
1158 d8252ab2e760b0d4e5288fd44cbd15a0fa567e16 644 d (no-changeset !)
1159 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
1159 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
1160 $ hg debugindex d | head -n 4
1160 $ hg debugindex d | head -n 4
1161 rev linkrev nodeid p1 p2
1161 rev linkrev nodeid p1 p2
1162 0 2 d8252ab2e760 000000000000 000000000000 (no-changeset !)
1162 0 2 d8252ab2e760 000000000000 000000000000 (no-changeset !)
1163 0 2 ae258f702dfe 000000000000 000000000000 (changeset !)
1163 0 2 ae258f702dfe 000000000000 000000000000 (changeset !)
1164 1 8 b004912a8510 000000000000 000000000000
1164 1 8 b004912a8510 000000000000 000000000000
1165 2 22 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
1165 2 22 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
1166 2 25 5cce88bf349f ae258f702dfe 000000000000 (changeset !)
1166 2 25 5cce88bf349f ae258f702dfe 000000000000 (changeset !)
1167
1167
1168 Log output should not include a merge commit as it did not happen
1168 Log output should not include a merge commit as it did not happen
1169
1169
1170 $ hg log -Gfr 'desc("mBDm-0")' d
1170 $ hg log -Gfr 'desc("mBDm-0")' d
1171 o 8 d-2 re-add d
1171 o 8 d-2 re-add d
1172 |
1172 |
1173 ~
1173 ~
1174
1174
1175 $ hg log -Gfr 'desc("mDBm-0")' d
1175 $ hg log -Gfr 'desc("mDBm-0")' d
1176 o 8 d-2 re-add d
1176 o 8 d-2 re-add d
1177 |
1177 |
1178 ~
1178 ~
1179
1179
1180 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
1180 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
1181 M b
1181 M b
1182 A d
1182 A d
1183 R a
1183 R a
1184 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
1184 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
1185 M b
1185 M b
1186 A d
1186 A d
1187 R a
1187 R a
1188
1188
1189
1189
1190 Comparing with a merge with colliding rename
1190 Comparing with a merge with colliding rename
1191 --------------------------------------------
1191 --------------------------------------------
1192
1192
1193 - the "e-" branch renaming b to f (through 'g')
1193 - the "e-" branch renaming b to f (through 'g')
1194 - the "a-" branch renaming d to f (through e)
1194 - the "a-" branch renaming d to f (through e)
1195
1195
1196 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
1196 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
1197 o 20 mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
1197 o 20 mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
1198 |\
1198 |\
1199 +---o 19 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
1199 +---o 19 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
1200 | |/
1200 | |/
1201 | o 10 e-2 g -move-> f
1201 | o 10 e-2 g -move-> f
1202 | |
1202 | |
1203 | o 9 e-1 b -move-> g
1203 | o 9 e-1 b -move-> g
1204 | |
1204 | |
1205 o | 4 a-2: e -move-> f
1205 o | 4 a-2: e -move-> f
1206 | |
1206 | |
1207 o | 3 a-1: d -move-> e
1207 o | 3 a-1: d -move-> e
1208 |/
1208 |/
1209 o 2 i-2: c -move-> d
1209 o 2 i-2: c -move-> d
1210 |
1210 |
1211 o 1 i-1: a -move-> c
1211 o 1 i-1: a -move-> c
1212 |
1212 |
1213 o 0 i-0 initial commit: a b h
1213 o 0 i-0 initial commit: a b h
1214
1214
1215 #if no-changeset
1215 #if no-changeset
1216 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1216 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1217 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1217 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1218 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1218 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1219 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1219 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
1220 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1220 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1221 b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f
1221 b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f
1222 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1222 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1223 e8825b386367b29fec957283a80bb47b47483fe1 644 f
1223 e8825b386367b29fec957283a80bb47b47483fe1 644 f
1224 $ hg debugindex f
1224 $ hg debugindex f
1225 rev linkrev nodeid p1 p2
1225 rev linkrev nodeid p1 p2
1226 0 4 b76eb76580df 000000000000 000000000000
1226 0 4 b76eb76580df 000000000000 000000000000
1227 1 10 e8825b386367 000000000000 000000000000
1227 1 10 e8825b386367 000000000000 000000000000
1228 2 19 2ff93c643948 b76eb76580df e8825b386367
1228 2 19 2ff93c643948 b76eb76580df e8825b386367
1229 #else
1229 #else
1230 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1230 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1231 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1231 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1232 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1232 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1233 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1233 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1234 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1234 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1235 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1235 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1236 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1236 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1237 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1237 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
1238 $ hg debugindex f
1238 $ hg debugindex f
1239 rev linkrev nodeid p1 p2
1239 rev linkrev nodeid p1 p2
1240 0 4 ae258f702dfe 000000000000 000000000000
1240 0 4 ae258f702dfe 000000000000 000000000000
1241 #endif
1241 #endif
1242
1242
1243 # Here the filelog based implementation is not looking at the rename
1243 # Here the filelog based implementation is not looking at the rename
1244 # information (because the file exist on both side). However the changelog
1244 # information (because the file exist on both side). However the changelog
1245 # based on works fine. We have different output.
1245 # based on works fine. We have different output.
1246
1246
1247 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
1247 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
1248 M f (no-changeset !)
1248 M f (no-changeset !)
1249 b (no-filelog no-changeset !)
1249 b (no-filelog no-changeset !)
1250 R b
1250 R b
1251 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
1251 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
1252 M f (no-changeset !)
1252 M f (no-changeset !)
1253 b (no-filelog no-changeset !)
1253 b (no-filelog no-changeset !)
1254 R b
1254 R b
1255 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
1255 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
1256 M f (no-changeset !)
1256 M f (no-changeset !)
1257 d (no-filelog no-changeset !)
1257 d (no-filelog no-changeset !)
1258 R d
1258 R d
1259 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
1259 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
1260 M f (no-changeset !)
1260 M f (no-changeset !)
1261 d (no-filelog no-changeset !)
1261 d (no-filelog no-changeset !)
1262 R d
1262 R d
1263 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
1263 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
1264 A f
1264 A f
1265 d
1265 d
1266 R d
1266 R d
1267 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
1267 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
1268 A f
1268 A f
1269 b
1269 b
1270 R b
1270 R b
1271
1271
1272 # From here, we run status against revision where both source file exists.
1272 # From here, we run status against revision where both source file exists.
1273 #
1273 #
1274 # The filelog based implementation picks an arbitrary side based on revision
1274 # The filelog based implementation picks an arbitrary side based on revision
1275 # numbers. So the same side "wins" whatever the parents order is. This is
1275 # numbers. So the same side "wins" whatever the parents order is. This is
1276 # sub-optimal because depending on revision numbers means the result can be
1276 # sub-optimal because depending on revision numbers means the result can be
1277 # different from one repository to the next.
1277 # different from one repository to the next.
1278 #
1278 #
1279 # The changeset based algorithm use the parent order to break tie on conflicting
1279 # The changeset based algorithm use the parent order to break tie on conflicting
1280 # information and will have a different order depending on who is p1 and p2.
1280 # information and will have a different order depending on who is p1 and p2.
1281 # That order is stable accross repositories. (data from p1 prevails)
1281 # That order is stable accross repositories. (data from p1 prevails)
1282
1282
1283 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
1283 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
1284 A f
1284 A f
1285 d
1285 d
1286 R b
1286 R b
1287 R d
1287 R d
1288 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
1288 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
1289 A f
1289 A f
1290 d (filelog !)
1290 d (filelog !)
1291 b (no-filelog !)
1291 b (no-filelog !)
1292 R b
1292 R b
1293 R d
1293 R d
1294 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
1294 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
1295 A f
1295 A f
1296 a
1296 a
1297 R a
1297 R a
1298 R b
1298 R b
1299 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
1299 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
1300 A f
1300 A f
1301 a (filelog !)
1301 a (filelog !)
1302 b (no-filelog !)
1302 b (no-filelog !)
1303 R a
1303 R a
1304 R b
1304 R b
1305
1305
1306
1306
1307 Note:
1307 Note:
1308 | In this case, one of the merge wrongly record a merge while there is none.
1308 | In this case, one of the merge wrongly record a merge while there is none.
1309 | This lead to bad copy tracing information to be dug up.
1309 | This lead to bad copy tracing information to be dug up.
1310
1310
1311
1311
1312 Merge:
1312 Merge:
1313 - one with change to an unrelated file (b)
1313 - one with change to an unrelated file (b)
1314 - one overwriting a file (d) with a rename (from h to i to d)
1314 - one overwriting a file (d) with a rename (from h to i to d)
1315
1315
1316 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
1316 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
1317 o 24 mFBm-0 simple merge - the other way
1317 o 24 mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
1318 |\
1318 |\
1319 +---o 23 mBFm-0 simple merge - one way
1319 +---o 23 mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
1320 | |/
1320 | |/
1321 | o 22 f-2: rename i -> d
1321 | o 22 f-2: rename i -> d
1322 | |
1322 | |
1323 | o 21 f-1: rename h -> i
1323 | o 21 f-1: rename h -> i
1324 | |
1324 | |
1325 o | 5 b-1: b update
1325 o | 5 b-1: b update
1326 |/
1326 |/
1327 o 2 i-2: c -move-> d
1327 o 2 i-2: c -move-> d
1328 |
1328 |
1329 o 1 i-1: a -move-> c
1329 o 1 i-1: a -move-> c
1330 |
1330 |
1331 o 0 i-0 initial commit: a b h
1331 o 0 i-0 initial commit: a b h
1332
1332
1333 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
1333 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-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("i-0")' --rev 'desc("mFBm-0")'
1339 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
1340 M b
1340 M b
1341 A d
1341 A d
1342 h
1342 h
1343 R a
1343 R a
1344 R h
1344 R h
1345 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
1345 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
1346 M d (no-changeset !)
1346 M d (no-changeset !)
1347 h (no-filelog no-changeset !)
1347 h (no-filelog no-changeset !)
1348 R h
1348 R h
1349 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
1349 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
1350 M b
1350 M b
1351 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
1351 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
1352 M b
1352 M b
1353 M d (no-changeset !)
1353 M d (no-changeset !)
1354 i (no-filelog no-changeset !)
1354 i (no-filelog no-changeset !)
1355 R i
1355 R i
1356 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
1356 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
1357 M d (no-changeset !)
1357 M d (no-changeset !)
1358 h (no-filelog no-changeset !)
1358 h (no-filelog no-changeset !)
1359 R h
1359 R h
1360 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
1360 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
1361 M b
1361 M b
1362 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
1362 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
1363 M b
1363 M b
1364 M d (no-changeset !)
1364 M d (no-changeset !)
1365 i (no-filelog no-changeset !)
1365 i (no-filelog no-changeset !)
1366 R i
1366 R i
1367
1367
1368 #if no-changeset
1368 #if no-changeset
1369 $ hg log -Gfr 'desc("mBFm-0")' d
1369 $ hg log -Gfr 'desc("mBFm-0")' d
1370 o 22 f-2: rename i -> d
1370 o 22 f-2: rename i -> d
1371 |
1371 |
1372 o 21 f-1: rename h -> i
1372 o 21 f-1: rename h -> i
1373 :
1373 :
1374 o 0 i-0 initial commit: a b h
1374 o 0 i-0 initial commit: a b h
1375
1375
1376 #else
1376 #else
1377 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1377 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1378 $ hg log -Gfr 'desc("mBFm-0")' d
1378 $ hg log -Gfr 'desc("mBFm-0")' d
1379 o 2 i-2: c -move-> d
1379 o 2 i-2: c -move-> d
1380 |
1380 |
1381 ~
1381 ~
1382 #endif
1382 #endif
1383
1383
1384 #if no-changeset
1384 #if no-changeset
1385 $ hg log -Gfr 'desc("mFBm-0")' d
1385 $ hg log -Gfr 'desc("mFBm-0")' d
1386 o 22 f-2: rename i -> d
1386 o 22 f-2: rename i -> d
1387 |
1387 |
1388 o 21 f-1: rename h -> i
1388 o 21 f-1: rename h -> i
1389 :
1389 :
1390 o 0 i-0 initial commit: a b h
1390 o 0 i-0 initial commit: a b h
1391
1391
1392 #else
1392 #else
1393 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1393 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1394 $ hg log -Gfr 'desc("mFBm-0")' d
1394 $ hg log -Gfr 'desc("mFBm-0")' d
1395 o 2 i-2: c -move-> d
1395 o 2 i-2: c -move-> d
1396 |
1396 |
1397 ~
1397 ~
1398 #endif
1398 #endif
1399
1399
1400
1400
1401 Merge:
1401 Merge:
1402 - one with change to a file
1402 - one with change to a file
1403 - one deleting and recreating the file
1403 - one deleting and recreating the file
1404
1404
1405 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
1405 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
1406 consider history and rename on both branch of the merge.
1406 consider history and rename on both branch of the merge.
1407
1407
1408 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
1408 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
1409 o 27 mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
1409 o 27 mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
1410 |\
1410 |\
1411 +---o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1411 +---o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1412 | |/
1412 | |/
1413 | o 25 g-1: update d
1413 | o 25 g-1: update d
1414 | |
1414 | |
1415 o | 8 d-2 re-add d
1415 o | 8 d-2 re-add d
1416 | |
1416 | |
1417 o | 7 d-1 delete d
1417 o | 7 d-1 delete d
1418 |/
1418 |/
1419 o 2 i-2: c -move-> d
1419 o 2 i-2: c -move-> d
1420 |
1420 |
1421 o 1 i-1: a -move-> c
1421 o 1 i-1: a -move-> c
1422 |
1422 |
1423 o 0 i-0 initial commit: a b h
1423 o 0 i-0 initial commit: a b h
1424
1424
1425 One side of the merge have a long history with rename. The other side of the
1425 One side of the merge have a long history with rename. The other side of the
1426 merge point to a new file with a smaller history. Each side is "valid".
1426 merge point to a new file with a smaller history. Each side is "valid".
1427
1427
1428 (and again the filelog based algorithm only explore one, with a pick based on
1428 (and again the filelog based algorithm only explore one, with a pick based on
1429 revision numbers)
1429 revision numbers)
1430
1430
1431 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
1431 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
1432 A d
1432 A d
1433 a (filelog !)
1433 a (filelog !)
1434 R a
1434 R a
1435 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
1435 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
1436 A d
1436 A d
1437 a
1437 a
1438 R a
1438 R a
1439 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
1439 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
1440 M d
1440 M d
1441 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
1441 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
1442 M d
1442 M d
1443 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
1443 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
1444 M d
1444 M d
1445 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
1445 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
1446 M d
1446 M d
1447
1447
1448 #if no-changeset
1448 #if no-changeset
1449 $ hg log -Gfr 'desc("mDGm-0")' d
1449 $ hg log -Gfr 'desc("mDGm-0")' d
1450 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1450 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1451 |\
1451 |\
1452 | o 25 g-1: update d
1452 | o 25 g-1: update d
1453 | |
1453 | |
1454 o | 8 d-2 re-add d
1454 o | 8 d-2 re-add d
1455 |/
1455 |/
1456 o 2 i-2: c -move-> d
1456 o 2 i-2: c -move-> d
1457 |
1457 |
1458 o 1 i-1: a -move-> c
1458 o 1 i-1: a -move-> c
1459 |
1459 |
1460 o 0 i-0 initial commit: a b h
1460 o 0 i-0 initial commit: a b h
1461
1461
1462 #else
1462 #else
1463 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1463 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1464 $ hg log -Gfr 'desc("mDGm-0")' d
1464 $ hg log -Gfr 'desc("mDGm-0")' d
1465 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1465 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1466 |\
1466 |\
1467 | o 25 g-1: update d
1467 | o 25 g-1: update d
1468 | |
1468 | |
1469 o | 8 d-2 re-add d
1469 o | 8 d-2 re-add d
1470 |/
1470 |/
1471 o 2 i-2: c -move-> d
1471 o 2 i-2: c -move-> d
1472 |
1472 |
1473 ~
1473 ~
1474 #endif
1474 #endif
1475
1475
1476
1476
1477 #if no-changeset
1477 #if no-changeset
1478 $ hg log -Gfr 'desc("mDGm-0")' d
1478 $ hg log -Gfr 'desc("mDGm-0")' d
1479 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1479 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1480 |\
1480 |\
1481 | o 25 g-1: update d
1481 | o 25 g-1: update d
1482 | |
1482 | |
1483 o | 8 d-2 re-add d
1483 o | 8 d-2 re-add d
1484 |/
1484 |/
1485 o 2 i-2: c -move-> d
1485 o 2 i-2: c -move-> d
1486 |
1486 |
1487 o 1 i-1: a -move-> c
1487 o 1 i-1: a -move-> c
1488 |
1488 |
1489 o 0 i-0 initial commit: a b h
1489 o 0 i-0 initial commit: a b h
1490
1490
1491 #else
1491 #else
1492 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1492 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1493 $ hg log -Gfr 'desc("mDGm-0")' d
1493 $ hg log -Gfr 'desc("mDGm-0")' d
1494 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1494 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1495 |\
1495 |\
1496 | o 25 g-1: update d
1496 | o 25 g-1: update d
1497 | |
1497 | |
1498 o | 8 d-2 re-add d
1498 o | 8 d-2 re-add d
1499 |/
1499 |/
1500 o 2 i-2: c -move-> d
1500 o 2 i-2: c -move-> d
1501 |
1501 |
1502 ~
1502 ~
1503 #endif
1503 #endif
1504
1504
1505
1505
1506 Merge:
1506 Merge:
1507 - one with change to a file (d)
1507 - one with change to a file (d)
1508 - one overwriting that file with a rename (from h to i, to d)
1508 - one overwriting that file with a rename (from h to i, to d)
1509
1509
1510 This case is similar to BF/FB, but an actual merge happens, so both side of the
1510 This case is similar to BF/FB, but an actual merge happens, so both side of the
1511 history are relevant.
1511 history are relevant.
1512
1512
1513
1513
1514 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
1514 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
1515 o 29 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
1515 o 29 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
1516 |\
1516 |\
1517 +---o 28 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
1517 +---o 28 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
1518 | |/
1518 | |/
1519 | o 25 g-1: update d
1519 | o 25 g-1: update d
1520 | |
1520 | |
1521 o | 22 f-2: rename i -> d
1521 o | 22 f-2: rename i -> d
1522 | |
1522 | |
1523 o | 21 f-1: rename h -> i
1523 o | 21 f-1: rename h -> i
1524 |/
1524 |/
1525 o 2 i-2: c -move-> d
1525 o 2 i-2: c -move-> d
1526 |
1526 |
1527 o 1 i-1: a -move-> c
1527 o 1 i-1: a -move-> c
1528 |
1528 |
1529 o 0 i-0 initial commit: a b h
1529 o 0 i-0 initial commit: a b h
1530
1530
1531
1531
1532 Note:
1532 Note:
1533 | In this case, the merge get conflicting information since on one side we have
1533 | In this case, the merge get conflicting information since on one side we have
1534 | "a -> c -> d". and one the other one we have "h -> i -> d".
1534 | "a -> c -> d". and one the other one we have "h -> i -> d".
1535 |
1535 |
1536 | The current code arbitrarily pick one side depending the ordering of the merged hash:
1536 | The current code arbitrarily pick one side depending the ordering of the merged hash:
1537
1537
1538 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"):
1538 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"):
1539
1539
1540 Details on this hash ordering pick:
1540 Details on this hash ordering pick:
1541
1541
1542 $ hg manifest --debug 'desc("g-1")' | egrep 'd$'
1542 $ hg manifest --debug 'desc("g-1")' | egrep 'd$'
1543 17ec97e605773eb44a117d1136b3849bcdc1924f 644 d (no-changeset !)
1543 17ec97e605773eb44a117d1136b3849bcdc1924f 644 d (no-changeset !)
1544 5cce88bf349f7c742bb440f2c53f81db9c294279 644 d (changeset !)
1544 5cce88bf349f7c742bb440f2c53f81db9c294279 644 d (changeset !)
1545 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("g-1")' d
1545 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("g-1")' d
1546 A d
1546 A d
1547 a (no-changeset no-compatibility !)
1547 a (no-changeset no-compatibility !)
1548
1548
1549 $ hg manifest --debug 'desc("f-2")' | egrep 'd$'
1549 $ hg manifest --debug 'desc("f-2")' | egrep 'd$'
1550 7b79e2fe0c8924e0e598a82f048a7b024afa4d96 644 d (no-changeset !)
1550 7b79e2fe0c8924e0e598a82f048a7b024afa4d96 644 d (no-changeset !)
1551 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
1551 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
1552 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("f-2")' d
1552 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("f-2")' d
1553 A d
1553 A d
1554 h (no-changeset no-compatibility !)
1554 h (no-changeset no-compatibility !)
1555
1555
1556 Copy tracing data on the resulting merge:
1556 Copy tracing data on the resulting merge:
1557
1557
1558 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
1558 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
1559 A d
1559 A d
1560 h (no-filelog !)
1560 h (no-filelog !)
1561 a (filelog !)
1561 a (filelog !)
1562 R a
1562 R a
1563 R h
1563 R h
1564 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
1564 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
1565 A d
1565 A d
1566 a (no-changeset !)
1566 a (no-changeset !)
1567 h (changeset !)
1567 h (changeset !)
1568 R a
1568 R a
1569 R h
1569 R h
1570 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
1570 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
1571 M d
1571 M d
1572 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
1572 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
1573 M d
1573 M d
1574 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
1574 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
1575 M d
1575 M d
1576 i (no-filelog !)
1576 i (no-filelog !)
1577 R i
1577 R i
1578 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
1578 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
1579 M d
1579 M d
1580 i (no-filelog !)
1580 i (no-filelog !)
1581 R i
1581 R i
1582 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
1582 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
1583 M d (no-changeset !)
1583 M d (no-changeset !)
1584 h (no-filelog no-changeset !)
1584 h (no-filelog no-changeset !)
1585 R h
1585 R h
1586 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
1586 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
1587 M d (no-changeset !)
1587 M d (no-changeset !)
1588 h (no-filelog no-changeset !)
1588 h (no-filelog no-changeset !)
1589 R h
1589 R h
1590
1590
1591 #if no-changeset
1591 #if no-changeset
1592 $ hg log -Gfr 'desc("mFGm-0")' d
1592 $ hg log -Gfr 'desc("mFGm-0")' d
1593 o 28 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
1593 o 28 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
1594 |\
1594 |\
1595 | o 25 g-1: update d
1595 | o 25 g-1: update d
1596 | |
1596 | |
1597 o | 22 f-2: rename i -> d
1597 o | 22 f-2: rename i -> d
1598 | |
1598 | |
1599 o | 21 f-1: rename h -> i
1599 o | 21 f-1: rename h -> i
1600 |/
1600 |/
1601 o 2 i-2: c -move-> d
1601 o 2 i-2: c -move-> d
1602 |
1602 |
1603 o 1 i-1: a -move-> c
1603 o 1 i-1: a -move-> c
1604 |
1604 |
1605 o 0 i-0 initial commit: a b h
1605 o 0 i-0 initial commit: a b h
1606
1606
1607 #else
1607 #else
1608 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1608 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1609 $ hg log -Gfr 'desc("mFGm-0")' d
1609 $ hg log -Gfr 'desc("mFGm-0")' d
1610 o 25 g-1: update d
1610 o 25 g-1: update d
1611 |
1611 |
1612 o 2 i-2: c -move-> d
1612 o 2 i-2: c -move-> d
1613 |
1613 |
1614 ~
1614 ~
1615 #endif
1615 #endif
1616
1616
1617 #if no-changeset
1617 #if no-changeset
1618 $ hg log -Gfr 'desc("mGFm-0")' d
1618 $ hg log -Gfr 'desc("mGFm-0")' d
1619 o 29 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
1619 o 29 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
1620 |\
1620 |\
1621 | o 25 g-1: update d
1621 | o 25 g-1: update d
1622 | |
1622 | |
1623 o | 22 f-2: rename i -> d
1623 o | 22 f-2: rename i -> d
1624 | |
1624 | |
1625 o | 21 f-1: rename h -> i
1625 o | 21 f-1: rename h -> i
1626 |/
1626 |/
1627 o 2 i-2: c -move-> d
1627 o 2 i-2: c -move-> d
1628 |
1628 |
1629 o 1 i-1: a -move-> c
1629 o 1 i-1: a -move-> c
1630 |
1630 |
1631 o 0 i-0 initial commit: a b h
1631 o 0 i-0 initial commit: a b h
1632
1632
1633 #else
1633 #else
1634 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1634 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1635 $ hg log -Gfr 'desc("mGFm-0")' d
1635 $ hg log -Gfr 'desc("mGFm-0")' d
1636 o 25 g-1: update d
1636 o 25 g-1: update d
1637 |
1637 |
1638 o 2 i-2: c -move-> d
1638 o 2 i-2: c -move-> d
1639 |
1639 |
1640 ~
1640 ~
1641 #endif
1641 #endif
1642
1642
1643
1643
1644 Comparing with merging with a deletion (and keeping the file)
1644 Comparing with merging with a deletion (and keeping the file)
1645 -------------------------------------------------------------
1645 -------------------------------------------------------------
1646
1646
1647 Merge:
1647 Merge:
1648 - one removing a file (d)
1648 - one removing a file (d)
1649 - one updating that file
1649 - one updating that file
1650 - the merge keep the modified version of the file (canceling the delete)
1650 - the merge keep the modified version of the file (canceling the delete)
1651
1651
1652 In this case, the file keep on living after the merge. So we should not drop its
1652 In this case, the file keep on living after the merge. So we should not drop its
1653 copy tracing chain.
1653 copy tracing chain.
1654
1654
1655 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
1655 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
1656 o 31 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
1656 o 31 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
1657 |\
1657 |\
1658 +---o 30 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
1658 +---o 30 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
1659 | |/
1659 | |/
1660 | o 25 g-1: update d
1660 | o 25 g-1: update d
1661 | |
1661 | |
1662 o | 6 c-1 delete d
1662 o | 6 c-1 delete d
1663 |/
1663 |/
1664 o 2 i-2: c -move-> d
1664 o 2 i-2: c -move-> d
1665 |
1665 |
1666 o 1 i-1: a -move-> c
1666 o 1 i-1: a -move-> c
1667 |
1667 |
1668 o 0 i-0 initial commit: a b h
1668 o 0 i-0 initial commit: a b h
1669
1669
1670
1670
1671 'a' is the copy source of 'd'
1671 'a' is the copy source of 'd'
1672
1672
1673 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")'
1673 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")'
1674 A d
1674 A d
1675 a (no-compatibility no-changeset !)
1675 a (no-compatibility no-changeset !)
1676 R a
1676 R a
1677 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")'
1677 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")'
1678 A d
1678 A d
1679 a (no-compatibility no-changeset !)
1679 a (no-compatibility no-changeset !)
1680 R a
1680 R a
1681 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")'
1681 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")'
1682 A d
1682 A d
1683 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")'
1683 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")'
1684 A d
1684 A d
1685 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")'
1685 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")'
1686 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")'
1686 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")'
1687
1687
1688
1688
1689 Comparing with merge restoring an untouched deleted file
1689 Comparing with merge restoring an untouched deleted file
1690 --------------------------------------------------------
1690 --------------------------------------------------------
1691
1691
1692 Merge:
1692 Merge:
1693 - one removing a file (d)
1693 - one removing a file (d)
1694 - one leaving the file untouched
1694 - one leaving the file untouched
1695 - the merge actively restore the file to the same content.
1695 - the merge actively restore the file to the same content.
1696
1696
1697 In this case, the file keep on living after the merge. So we should not drop its
1697 In this case, the file keep on living after the merge. So we should not drop its
1698 copy tracing chain.
1698 copy tracing chain.
1699
1699
1700 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
1700 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
1701 o 33 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
1701 o 33 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
1702 |\
1702 |\
1703 +---o 32 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
1703 +---o 32 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
1704 | |/
1704 | |/
1705 | o 6 c-1 delete d
1705 | o 6 c-1 delete d
1706 | |
1706 | |
1707 o | 5 b-1: b update
1707 o | 5 b-1: b update
1708 |/
1708 |/
1709 o 2 i-2: c -move-> d
1709 o 2 i-2: c -move-> d
1710 |
1710 |
1711 o 1 i-1: a -move-> c
1711 o 1 i-1: a -move-> c
1712 |
1712 |
1713 o 0 i-0 initial commit: a b h
1713 o 0 i-0 initial commit: a b h
1714
1714
1715
1715
1716 'a' is the the copy source of 'd'
1716 'a' is the the copy source of 'd'
1717
1717
1718 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
1718 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
1719 M b
1719 M b
1720 A d
1720 A d
1721 a (no-compatibility no-changeset !)
1721 a (no-compatibility no-changeset !)
1722 R a
1722 R a
1723 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
1723 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
1724 M b
1724 M b
1725 A d
1725 A d
1726 a (no-compatibility no-changeset !)
1726 a (no-compatibility no-changeset !)
1727 R a
1727 R a
1728 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")'
1728 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")'
1729 M b
1729 M b
1730 A d
1730 A d
1731 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")'
1731 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")'
1732 M b
1732 M b
1733 A d
1733 A d
1734 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")'
1734 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")'
1735 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")'
1735 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")'
1736
1736
1737
1737
1738 Merging a branch where a rename was deleted with a branch where the same file was renamed
1738 Merging a branch where a rename was deleted with a branch where the same file was renamed
1739 ------------------------------------------------------------------------------------------
1739 ------------------------------------------------------------------------------------------
1740
1740
1741 Create a "conflicting" merge where `d` get removed on one branch before its
1741 Create a "conflicting" merge where `d` get removed on one branch before its
1742 rename information actually conflict with the other branch.
1742 rename information actually conflict with the other branch.
1743
1743
1744 (the copy information from the branch that was not deleted should win).
1744 (the copy information from the branch that was not deleted should win).
1745
1745
1746 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
1746 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
1747 o 36 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
1747 o 36 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
1748 |\
1748 |\
1749 +---o 35 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
1749 +---o 35 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
1750 | |/
1750 | |/
1751 | o 34 h-1: b -(move)-> d
1751 | o 34 h-1: b -(move)-> d
1752 | |
1752 | |
1753 o | 6 c-1 delete d
1753 o | 6 c-1 delete d
1754 | |
1754 | |
1755 o | 2 i-2: c -move-> d
1755 o | 2 i-2: c -move-> d
1756 | |
1756 | |
1757 o | 1 i-1: a -move-> c
1757 o | 1 i-1: a -move-> c
1758 |/
1758 |/
1759 o 0 i-0 initial commit: a b h
1759 o 0 i-0 initial commit: a b h
1760
1760
1761
1761
1762 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCH-delete-before-conflict-m")'
1762 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCH-delete-before-conflict-m")'
1763 A d
1763 A d
1764 b (no-compatibility no-changeset !)
1764 b (no-compatibility no-changeset !)
1765 R a
1765 R a
1766 R b
1766 R b
1767 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mHC-delete-before-conflict-m")'
1767 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mHC-delete-before-conflict-m")'
1768 A d
1768 A d
1769 b
1769 b
1770 R a
1770 R a
1771 R b
1771 R b
1772 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1772 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1773 A d
1773 A d
1774 b
1774 b
1775 R b
1775 R b
1776 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1776 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1777 A d
1777 A d
1778 b
1778 b
1779 R b
1779 R b
1780 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1780 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1781 R a
1781 R a
1782 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1782 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1783 R a
1783 R a
General Comments 0
You need to be logged in to leave comments. Login now