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