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