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