Show More
@@ -1,471 +1,693 b'' | |||
|
1 | 1 | Criss cross merging |
|
2 | 2 | |
|
3 | 3 | $ hg init criss-cross |
|
4 | 4 | $ cd criss-cross |
|
5 | 5 | $ echo '0 base' > f1 |
|
6 | 6 | $ echo '0 base' > f2 |
|
7 | 7 | $ hg ci -Aqm '0 base' |
|
8 | 8 | |
|
9 | 9 | $ echo '1 first change' > f1 |
|
10 | 10 | $ hg ci -m '1 first change f1' |
|
11 | 11 | |
|
12 | 12 | $ hg up -qr0 |
|
13 | 13 | $ echo '2 first change' > f2 |
|
14 | 14 | $ hg ci -qm '2 first change f2' |
|
15 | 15 | |
|
16 | 16 | $ hg merge -qr 1 |
|
17 | 17 | $ hg ci -m '3 merge' |
|
18 | 18 | |
|
19 | 19 | $ hg up -qr2 |
|
20 | 20 | $ hg merge -qr1 |
|
21 | 21 | $ hg ci -qm '4 merge' |
|
22 | 22 | |
|
23 | 23 | $ echo '5 second change' > f1 |
|
24 | 24 | $ hg ci -m '5 second change f1' |
|
25 | 25 | |
|
26 | 26 | $ hg up -r3 |
|
27 | 27 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
28 | 28 | $ echo '6 second change' > f2 |
|
29 | 29 | $ hg ci -m '6 second change f2' |
|
30 | 30 | |
|
31 | 31 | $ hg log -G |
|
32 | 32 | @ changeset: 6:3b08d01b0ab5 |
|
33 | 33 | | tag: tip |
|
34 | 34 | | parent: 3:cf89f02107e5 |
|
35 | 35 | | user: test |
|
36 | 36 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
37 | 37 | | summary: 6 second change f2 |
|
38 | 38 | | |
|
39 | 39 | | o changeset: 5:adfe50279922 |
|
40 | 40 | | | user: test |
|
41 | 41 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
42 | 42 | | | summary: 5 second change f1 |
|
43 | 43 | | | |
|
44 | 44 | | o changeset: 4:7d3e55501ae6 |
|
45 | 45 | | |\ parent: 2:40663881a6dd |
|
46 | 46 | | | | parent: 1:0f6b37dbe527 |
|
47 | 47 | | | | user: test |
|
48 | 48 | | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
49 | 49 | | | | summary: 4 merge |
|
50 | 50 | | | | |
|
51 | 51 | o---+ changeset: 3:cf89f02107e5 |
|
52 | 52 | | | | parent: 2:40663881a6dd |
|
53 | 53 | |/ / parent: 1:0f6b37dbe527 |
|
54 | 54 | | | user: test |
|
55 | 55 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
56 | 56 | | | summary: 3 merge |
|
57 | 57 | | | |
|
58 | 58 | | o changeset: 2:40663881a6dd |
|
59 | 59 | | | parent: 0:40494bf2444c |
|
60 | 60 | | | user: test |
|
61 | 61 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
62 | 62 | | | summary: 2 first change f2 |
|
63 | 63 | | | |
|
64 | 64 | o | changeset: 1:0f6b37dbe527 |
|
65 | 65 | |/ user: test |
|
66 | 66 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
67 | 67 | | summary: 1 first change f1 |
|
68 | 68 | | |
|
69 | 69 | o changeset: 0:40494bf2444c |
|
70 | 70 | user: test |
|
71 | 71 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
72 | 72 | summary: 0 base |
|
73 | 73 | |
|
74 | 74 | |
|
75 | 75 | $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor='!' |
|
76 | 76 | note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922 |
|
77 | 77 | alternatively, use --config merge.preferancestor=40663881a6dd |
|
78 | 78 | resolving manifests |
|
79 | 79 | branchmerge: True, force: False, partial: False |
|
80 | 80 | ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922 |
|
81 | 81 | preserving f2 for resolve of f2 |
|
82 | 82 | f1: remote is newer -> g |
|
83 | 83 | getting f1 |
|
84 | 84 | f2: versions differ -> m (premerge) |
|
85 | 85 | picked tool ':dump' for f2 (binary False symlink False changedelete False) |
|
86 | 86 | merging f2 |
|
87 | 87 | my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527 |
|
88 | 88 | f2: versions differ -> m (merge) |
|
89 | 89 | picked tool ':dump' for f2 (binary False symlink False changedelete False) |
|
90 | 90 | my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527 |
|
91 | 91 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
92 | 92 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
93 | 93 | [1] |
|
94 | 94 | |
|
95 | 95 | $ f --dump * |
|
96 | 96 | f1: |
|
97 | 97 | >>> |
|
98 | 98 | 5 second change |
|
99 | 99 | <<< |
|
100 | 100 | f2: |
|
101 | 101 | >>> |
|
102 | 102 | 6 second change |
|
103 | 103 | <<< |
|
104 | 104 | f2.base: |
|
105 | 105 | >>> |
|
106 | 106 | 0 base |
|
107 | 107 | <<< |
|
108 | 108 | f2.local: |
|
109 | 109 | >>> |
|
110 | 110 | 6 second change |
|
111 | 111 | <<< |
|
112 | 112 | f2.orig: |
|
113 | 113 | >>> |
|
114 | 114 | 6 second change |
|
115 | 115 | <<< |
|
116 | 116 | f2.other: |
|
117 | 117 | >>> |
|
118 | 118 | 2 first change |
|
119 | 119 | <<< |
|
120 | 120 | |
|
121 | 121 | $ hg up -qC . |
|
122 | 122 | $ hg merge -v --tool internal:dump 5 --config merge.preferancestor="null 40663881 3b08d" |
|
123 | 123 | note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922 |
|
124 | 124 | alternatively, use --config merge.preferancestor=0f6b37dbe527 |
|
125 | 125 | resolving manifests |
|
126 | 126 | merging f1 |
|
127 | 127 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
128 | 128 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
129 | 129 | [1] |
|
130 | 130 | |
|
131 | 131 | Redo merge with merge.preferancestor="*" to enable bid merge |
|
132 | 132 | |
|
133 | 133 | $ rm f* |
|
134 | 134 | $ hg up -qC . |
|
135 | 135 | $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor="*" |
|
136 | 136 | note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd |
|
137 | 137 | |
|
138 | 138 | calculating bids for ancestor 0f6b37dbe527 |
|
139 | 139 | resolving manifests |
|
140 | 140 | branchmerge: True, force: False, partial: False |
|
141 | 141 | ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922 |
|
142 | 142 | f1: remote is newer -> g |
|
143 | 143 | f2: versions differ -> m |
|
144 | 144 | |
|
145 | 145 | calculating bids for ancestor 40663881a6dd |
|
146 | 146 | resolving manifests |
|
147 | 147 | branchmerge: True, force: False, partial: False |
|
148 | 148 | ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922 |
|
149 | 149 | f1: versions differ -> m |
|
150 | 150 | f2: remote unchanged -> k |
|
151 | 151 | |
|
152 | 152 | auction for merging merge bids (2 ancestors) |
|
153 | 153 | list of bids for f1: |
|
154 | 154 | remote is newer -> g |
|
155 | 155 | versions differ -> m |
|
156 | 156 | f1: picking 'get' action |
|
157 | 157 | list of bids for f2: |
|
158 | 158 | remote unchanged -> k |
|
159 | 159 | versions differ -> m |
|
160 | 160 | f2: picking 'keep' action |
|
161 | 161 | end of auction |
|
162 | 162 | |
|
163 | 163 | f1: remote is newer -> g |
|
164 | 164 | getting f1 |
|
165 | 165 | f2: remote unchanged -> k |
|
166 | 166 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
167 | 167 | (branch merge, don't forget to commit) |
|
168 | 168 | |
|
169 | 169 | $ f --dump * |
|
170 | 170 | f1: |
|
171 | 171 | >>> |
|
172 | 172 | 5 second change |
|
173 | 173 | <<< |
|
174 | 174 | f2: |
|
175 | 175 | >>> |
|
176 | 176 | 6 second change |
|
177 | 177 | <<< |
|
178 | 178 | |
|
179 | 179 | |
|
180 | 180 | The other way around: |
|
181 | 181 | |
|
182 | 182 | $ hg up -C -r5 |
|
183 | 183 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
184 | 184 | $ hg merge -v --debug --config merge.preferancestor="*" |
|
185 | 185 | note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd |
|
186 | 186 | |
|
187 | 187 | calculating bids for ancestor 0f6b37dbe527 |
|
188 | 188 | resolving manifests |
|
189 | 189 | branchmerge: True, force: False, partial: False |
|
190 | 190 | ancestor: 0f6b37dbe527, local: adfe50279922+, remote: 3b08d01b0ab5 |
|
191 | 191 | f1: remote unchanged -> k |
|
192 | 192 | f2: versions differ -> m |
|
193 | 193 | |
|
194 | 194 | calculating bids for ancestor 40663881a6dd |
|
195 | 195 | resolving manifests |
|
196 | 196 | branchmerge: True, force: False, partial: False |
|
197 | 197 | ancestor: 40663881a6dd, local: adfe50279922+, remote: 3b08d01b0ab5 |
|
198 | 198 | f1: versions differ -> m |
|
199 | 199 | f2: remote is newer -> g |
|
200 | 200 | |
|
201 | 201 | auction for merging merge bids (2 ancestors) |
|
202 | 202 | list of bids for f1: |
|
203 | 203 | remote unchanged -> k |
|
204 | 204 | versions differ -> m |
|
205 | 205 | f1: picking 'keep' action |
|
206 | 206 | list of bids for f2: |
|
207 | 207 | remote is newer -> g |
|
208 | 208 | versions differ -> m |
|
209 | 209 | f2: picking 'get' action |
|
210 | 210 | end of auction |
|
211 | 211 | |
|
212 | 212 | f2: remote is newer -> g |
|
213 | 213 | getting f2 |
|
214 | 214 | f1: remote unchanged -> k |
|
215 | 215 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
216 | 216 | (branch merge, don't forget to commit) |
|
217 | 217 | |
|
218 | 218 | $ f --dump * |
|
219 | 219 | f1: |
|
220 | 220 | >>> |
|
221 | 221 | 5 second change |
|
222 | 222 | <<< |
|
223 | 223 | f2: |
|
224 | 224 | >>> |
|
225 | 225 | 6 second change |
|
226 | 226 | <<< |
|
227 | 227 | |
|
228 | 228 | Verify how the output looks and and how verbose it is: |
|
229 | 229 | |
|
230 | 230 | $ hg up -qC |
|
231 | 231 | $ hg merge |
|
232 | 232 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
233 | 233 | (branch merge, don't forget to commit) |
|
234 | 234 | |
|
235 | 235 | $ hg up -qC tip |
|
236 | 236 | $ hg merge -v |
|
237 | 237 | note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd |
|
238 | 238 | |
|
239 | 239 | calculating bids for ancestor 0f6b37dbe527 |
|
240 | 240 | resolving manifests |
|
241 | 241 | |
|
242 | 242 | calculating bids for ancestor 40663881a6dd |
|
243 | 243 | resolving manifests |
|
244 | 244 | |
|
245 | 245 | auction for merging merge bids (2 ancestors) |
|
246 | 246 | f1: picking 'get' action |
|
247 | 247 | f2: picking 'keep' action |
|
248 | 248 | end of auction |
|
249 | 249 | |
|
250 | 250 | getting f1 |
|
251 | 251 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
252 | 252 | (branch merge, don't forget to commit) |
|
253 | 253 | |
|
254 | 254 | $ hg up -qC |
|
255 | 255 | $ hg merge -v --debug --config merge.preferancestor="*" |
|
256 | 256 | note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd |
|
257 | 257 | |
|
258 | 258 | calculating bids for ancestor 0f6b37dbe527 |
|
259 | 259 | resolving manifests |
|
260 | 260 | branchmerge: True, force: False, partial: False |
|
261 | 261 | ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922 |
|
262 | 262 | f1: remote is newer -> g |
|
263 | 263 | f2: versions differ -> m |
|
264 | 264 | |
|
265 | 265 | calculating bids for ancestor 40663881a6dd |
|
266 | 266 | resolving manifests |
|
267 | 267 | branchmerge: True, force: False, partial: False |
|
268 | 268 | ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922 |
|
269 | 269 | f1: versions differ -> m |
|
270 | 270 | f2: remote unchanged -> k |
|
271 | 271 | |
|
272 | 272 | auction for merging merge bids (2 ancestors) |
|
273 | 273 | list of bids for f1: |
|
274 | 274 | remote is newer -> g |
|
275 | 275 | versions differ -> m |
|
276 | 276 | f1: picking 'get' action |
|
277 | 277 | list of bids for f2: |
|
278 | 278 | remote unchanged -> k |
|
279 | 279 | versions differ -> m |
|
280 | 280 | f2: picking 'keep' action |
|
281 | 281 | end of auction |
|
282 | 282 | |
|
283 | 283 | f1: remote is newer -> g |
|
284 | 284 | getting f1 |
|
285 | 285 | f2: remote unchanged -> k |
|
286 | 286 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
287 | 287 | (branch merge, don't forget to commit) |
|
288 | 288 | |
|
289 | 289 | Test the greatest common ancestor returning multiple changesets |
|
290 | 290 | |
|
291 | 291 | $ hg log -r 'heads(commonancestors(head()))' |
|
292 | 292 | changeset: 1:0f6b37dbe527 |
|
293 | 293 | user: test |
|
294 | 294 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
295 | 295 | summary: 1 first change f1 |
|
296 | 296 | |
|
297 | 297 | changeset: 2:40663881a6dd |
|
298 | 298 | parent: 0:40494bf2444c |
|
299 | 299 | user: test |
|
300 | 300 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
301 | 301 | summary: 2 first change f2 |
|
302 | 302 | |
|
303 | 303 | |
|
304 | 304 | $ cd .. |
|
305 | 305 | |
|
306 | 306 | http://stackoverflow.com/questions/9350005/how-do-i-specify-a-merge-base-to-use-in-a-hg-merge/9430810 |
|
307 | 307 | |
|
308 | 308 | $ hg init ancestor-merging |
|
309 | 309 | $ cd ancestor-merging |
|
310 | 310 | $ echo a > x |
|
311 | 311 | $ hg commit -A -m a x |
|
312 | 312 | $ hg update -q 0 |
|
313 | 313 | $ echo b >> x |
|
314 | 314 | $ hg commit -m b |
|
315 | 315 | $ hg update -q 0 |
|
316 | 316 | $ echo c >> x |
|
317 | 317 | $ hg commit -qm c |
|
318 | 318 | $ hg update -q 1 |
|
319 | 319 | $ hg merge -q --tool internal:local 2 |
|
320 | 320 | $ echo c >> x |
|
321 | 321 | $ hg commit -m bc |
|
322 | 322 | $ hg update -q 2 |
|
323 | 323 | $ hg merge -q --tool internal:local 1 |
|
324 | 324 | $ echo b >> x |
|
325 | 325 | $ hg commit -qm cb |
|
326 | 326 | |
|
327 | 327 | $ hg merge --config merge.preferancestor='!' |
|
328 | 328 | note: using 70008a2163f6 as ancestor of 0d355fdef312 and 4b8b546a3eef |
|
329 | 329 | alternatively, use --config merge.preferancestor=b211bbc6eb3c |
|
330 | 330 | merging x |
|
331 | 331 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
332 | 332 | (branch merge, don't forget to commit) |
|
333 | 333 | $ cat x |
|
334 | 334 | a |
|
335 | 335 | c |
|
336 | 336 | b |
|
337 | 337 | c |
|
338 | 338 | |
|
339 | 339 | $ hg up -qC . |
|
340 | 340 | |
|
341 | 341 | $ hg merge --config merge.preferancestor=b211bbc6eb3c |
|
342 | 342 | note: using b211bbc6eb3c as ancestor of 0d355fdef312 and 4b8b546a3eef |
|
343 | 343 | alternatively, use --config merge.preferancestor=70008a2163f6 |
|
344 | 344 | merging x |
|
345 | 345 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
346 | 346 | (branch merge, don't forget to commit) |
|
347 | 347 | $ cat x |
|
348 | 348 | a |
|
349 | 349 | b |
|
350 | 350 | c |
|
351 | 351 | b |
|
352 | 352 | |
|
353 | 353 | $ hg up -qC . |
|
354 | 354 | |
|
355 | 355 | $ hg merge -v --config merge.preferancestor="*" |
|
356 | 356 | note: merging 0d355fdef312+ and 4b8b546a3eef using bids from ancestors 70008a2163f6 and b211bbc6eb3c |
|
357 | 357 | |
|
358 | 358 | calculating bids for ancestor 70008a2163f6 |
|
359 | 359 | resolving manifests |
|
360 | 360 | |
|
361 | 361 | calculating bids for ancestor b211bbc6eb3c |
|
362 | 362 | resolving manifests |
|
363 | 363 | |
|
364 | 364 | auction for merging merge bids (2 ancestors) |
|
365 | 365 | x: multiple bids for merge action: |
|
366 | 366 | versions differ -> m |
|
367 | 367 | versions differ -> m |
|
368 | 368 | x: ambiguous merge - picked m action |
|
369 | 369 | end of auction |
|
370 | 370 | |
|
371 | 371 | merging x |
|
372 | 372 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
373 | 373 | (branch merge, don't forget to commit) |
|
374 | 374 | $ cat x |
|
375 | 375 | a |
|
376 | 376 | c |
|
377 | 377 | b |
|
378 | 378 | c |
|
379 | 379 | |
|
380 | 380 | Verify that the old context ancestor works with / despite preferancestor: |
|
381 | 381 | |
|
382 | 382 | $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n' |
|
383 | 383 | 1 |
|
384 | 384 | $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n' |
|
385 | 385 | 2 |
|
386 | 386 | $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n' |
|
387 | 387 | 1 |
|
388 | 388 | $ hg log -r 'ancestor(head())' --config merge.preferancestor='1337 * - 2' -T '{rev}\n' |
|
389 | 389 | 2 |
|
390 | 390 | |
|
391 | 391 | $ cd .. |
|
392 | 392 | |
|
393 | 393 | $ hg init issue5020 |
|
394 | 394 | $ cd issue5020 |
|
395 | 395 | |
|
396 | 396 | $ echo a > noop |
|
397 | 397 | $ hg ci -qAm initial |
|
398 | 398 | |
|
399 | 399 | $ echo b > noop |
|
400 | 400 | $ hg ci -qAm 'uninteresting change' |
|
401 | 401 | |
|
402 | 402 | $ hg up -q 0 |
|
403 | 403 | $ mkdir d1 |
|
404 | 404 | $ echo a > d1/a |
|
405 | 405 | $ echo b > d1/b |
|
406 | 406 | $ hg ci -qAm 'add d1/a and d1/b' |
|
407 | 407 | |
|
408 | 408 | $ hg merge -q 1 |
|
409 | 409 | $ hg rm d1/a |
|
410 | 410 | $ hg mv -q d1 d2 |
|
411 | 411 | $ hg ci -qm 'merge while removing d1/a and moving d1/b to d2/b' |
|
412 | 412 | |
|
413 | 413 | $ hg up -q 1 |
|
414 | 414 | $ hg merge -q 2 |
|
415 | 415 | $ hg ci -qm 'merge (no changes while merging)' |
|
416 | 416 | $ hg log -G -T '{rev}:{node|short} {desc}' |
|
417 | 417 | @ 4:c0ef19750a22 merge (no changes while merging) |
|
418 | 418 | |\ |
|
419 | 419 | +---o 3:6ca01f7342b9 merge while removing d1/a and moving d1/b to d2/b |
|
420 | 420 | | |/ |
|
421 | 421 | | o 2:154e6000f54e add d1/a and d1/b |
|
422 | 422 | | | |
|
423 | 423 | o | 1:11b5b303e36c uninteresting change |
|
424 | 424 | |/ |
|
425 | 425 | o 0:7b54db1ebf33 initial |
|
426 | 426 | |
|
427 | 427 | $ hg merge 3 --debug |
|
428 | 428 | note: merging c0ef19750a22+ and 6ca01f7342b9 using bids from ancestors 11b5b303e36c and 154e6000f54e |
|
429 | 429 | |
|
430 | 430 | calculating bids for ancestor 11b5b303e36c |
|
431 | 431 | resolving manifests |
|
432 | 432 | branchmerge: True, force: False, partial: False |
|
433 | 433 | ancestor: 11b5b303e36c, local: c0ef19750a22+, remote: 6ca01f7342b9 |
|
434 | 434 | d2/b: remote created -> g |
|
435 | 435 | |
|
436 | 436 | calculating bids for ancestor 154e6000f54e |
|
437 | 437 | unmatched files in other: |
|
438 | 438 | d2/b |
|
439 | 439 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): |
|
440 | 440 | on remote side: |
|
441 | 441 | src: 'd1/b' -> dst: 'd2/b' |
|
442 | 442 | checking for directory renames |
|
443 | 443 | discovered dir src: 'd1/' -> dst: 'd2/' |
|
444 | 444 | resolving manifests |
|
445 | 445 | branchmerge: True, force: False, partial: False |
|
446 | 446 | ancestor: 154e6000f54e, local: c0ef19750a22+, remote: 6ca01f7342b9 |
|
447 | 447 | d1/a: other deleted -> r |
|
448 | 448 | d1/b: other deleted -> r |
|
449 | 449 | d2/b: remote created -> g |
|
450 | 450 | |
|
451 | 451 | auction for merging merge bids (2 ancestors) |
|
452 | 452 | list of bids for d1/a: |
|
453 | 453 | other deleted -> r |
|
454 | 454 | d1/a: consensus for r |
|
455 | 455 | list of bids for d1/b: |
|
456 | 456 | other deleted -> r |
|
457 | 457 | d1/b: consensus for r |
|
458 | 458 | list of bids for d2/b: |
|
459 | 459 | remote created -> g |
|
460 | 460 | remote created -> g |
|
461 | 461 | d2/b: consensus for g |
|
462 | 462 | end of auction |
|
463 | 463 | |
|
464 | 464 | d1/a: other deleted -> r |
|
465 | 465 | removing d1/a |
|
466 | 466 | d1/b: other deleted -> r |
|
467 | 467 | removing d1/b |
|
468 | 468 | d2/b: remote created -> g |
|
469 | 469 | getting d2/b |
|
470 | 470 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
471 | 471 | (branch merge, don't forget to commit) |
|
472 | ||
|
473 | ||
|
474 | Check that removal reversion does not go unotified | |
|
475 | ================================================== | |
|
476 | ||
|
477 | On a merge, a file can be removed and user can revert that removal. This means | |
|
478 | user has made an explicit choice of keeping the file or reverting the removal | |
|
479 | even though the merge algo wanted to remove it. | |
|
480 | Based on this, when we do criss cross merges, merge algorithm should not again | |
|
481 | choose to remove the file as in one of the merges, user made an explicit choice | |
|
482 | to revert the removal. | |
|
483 | Following test cases demonstrate how merge algo does not take in account | |
|
484 | explicit choices made by users to revert the removal and on criss-cross merging | |
|
485 | removes the file again. | |
|
486 | ||
|
487 | "Simple" case where the filenode changes | |
|
488 | ---------------------------------------- | |
|
489 | ||
|
490 | $ cd .. | |
|
491 | $ hg init criss-cross-merge-reversal-with-update | |
|
492 | $ cd criss-cross-merge-reversal-with-update | |
|
493 | $ echo the-file > the-file | |
|
494 | $ echo other-file > other-file | |
|
495 | $ hg add the-file other-file | |
|
496 | $ hg ci -m 'root-commit' | |
|
497 | $ echo foo >> the-file | |
|
498 | $ echo bar >> other-file | |
|
499 | $ hg ci -m 'updating-both-file' | |
|
500 | $ hg up 'desc("root-commit")' | |
|
501 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
502 | $ hg rm the-file | |
|
503 | $ hg ci -m 'delete-the-file' | |
|
504 | created new head | |
|
505 | $ hg log -G -T '{node|short} {desc}\n' | |
|
506 | @ 7801bc9b9899 delete-the-file | |
|
507 | | | |
|
508 | | o 9b610631ab29 updating-both-file | |
|
509 | |/ | |
|
510 | o 955800955977 root-commit | |
|
511 | ||
|
512 | ||
|
513 | Do all the merge combination (from the deleted or the update side × keeping and deleting the file | |
|
514 | ||
|
515 | $ hg update 'desc("delete-the-file")' | |
|
516 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
517 | $ hg merge 'desc("updating-both-file")' -t :local | |
|
518 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
|
519 | (branch merge, don't forget to commit) | |
|
520 | $ hg ci -m "merge-deleting-the-file-from-deleted" | |
|
521 | $ hg manifest | |
|
522 | other-file | |
|
523 | ||
|
524 | $ hg update 'desc("updating-both-file")' | |
|
525 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
526 | $ hg merge 'desc("delete-the-file")' -t :other | |
|
527 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
528 | (branch merge, don't forget to commit) | |
|
529 | $ hg ci -m "merge-deleting-the-file-from-updated" | |
|
530 | created new head | |
|
531 | $ hg manifest | |
|
532 | other-file | |
|
533 | ||
|
534 | $ hg update 'desc("delete-the-file")' | |
|
535 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
536 | $ hg merge 'desc("updating-both-file")' -t :other | |
|
537 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
|
538 | (branch merge, don't forget to commit) | |
|
539 | $ hg ci -m "merge-keeping-the-file-from-deleted" | |
|
540 | created new head | |
|
541 | $ hg manifest | |
|
542 | other-file | |
|
543 | the-file | |
|
544 | ||
|
545 | $ hg update 'desc("updating-both-file")' | |
|
546 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
547 | $ hg merge 'desc("delete-the-file")' -t :local | |
|
548 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
|
549 | (branch merge, don't forget to commit) | |
|
550 | $ hg ci -m "merge-keeping-the-file-from-updated" | |
|
551 | created new head | |
|
552 | $ hg manifest | |
|
553 | other-file | |
|
554 | the-file | |
|
555 | ||
|
556 | There the resulting merge together (leading to criss cross situation). Check | |
|
557 | the conflict is properly detected. | |
|
558 | ||
|
559 | (merging two deletion together → no conflict) | |
|
560 | ||
|
561 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' | |
|
562 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
563 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' | |
|
564 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
565 | (branch merge, don't forget to commit) | |
|
566 | $ ls -1 | |
|
567 | other-file | |
|
568 | ||
|
569 | (merging a deletion with keeping → conflict) | |
|
570 | BROKEN: this should result in conflict | |
|
571 | ||
|
572 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' | |
|
573 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
574 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' | |
|
575 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
576 | (branch merge, don't forget to commit) | |
|
577 | $ ls -1 | |
|
578 | other-file | |
|
579 | the-file | |
|
580 | ||
|
581 | (merging a deletion with keeping → conflict) | |
|
582 | BROKEN: this should result in conflict | |
|
583 | ||
|
584 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' | |
|
585 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
586 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' | |
|
587 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
588 | (branch merge, don't forget to commit) | |
|
589 | $ ls -1 | |
|
590 | other-file | |
|
591 | the-file | |
|
592 | ||
|
593 | (merging two deletion together → no conflict) | |
|
594 | ||
|
595 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' | |
|
596 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
597 | $ hg merge 'desc("merge-deleting-the-file-from-deleted")' | |
|
598 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
599 | (branch merge, don't forget to commit) | |
|
600 | $ ls -1 | |
|
601 | other-file | |
|
602 | ||
|
603 | (merging a deletion with keeping → conflict) | |
|
604 | BROKEN: this should result in conflict | |
|
605 | ||
|
606 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' | |
|
607 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
608 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' | |
|
609 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
610 | (branch merge, don't forget to commit) | |
|
611 | $ ls -1 | |
|
612 | other-file | |
|
613 | the-file | |
|
614 | ||
|
615 | (merging a deletion with keeping → conflict) | |
|
616 | BROKEN: this should result in conflict | |
|
617 | ||
|
618 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' | |
|
619 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
620 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' | |
|
621 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
622 | (branch merge, don't forget to commit) | |
|
623 | $ ls -1 | |
|
624 | other-file | |
|
625 | the-file | |
|
626 | ||
|
627 | (merging two "keeping" together → no conflict) | |
|
628 | ||
|
629 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' | |
|
630 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
631 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' | |
|
632 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
633 | (branch merge, don't forget to commit) | |
|
634 | $ ls -1 | |
|
635 | other-file | |
|
636 | the-file | |
|
637 | ||
|
638 | (merging a deletion with keeping → conflict) | |
|
639 | BROKEN: this should result in conflict | |
|
640 | ||
|
641 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' | |
|
642 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
643 | $ hg merge 'desc("merge-deleted-the-file-from-deleted")' | |
|
644 | abort: empty revision set | |
|
645 | [255] | |
|
646 | $ ls -1 | |
|
647 | other-file | |
|
648 | the-file | |
|
649 | ||
|
650 | (merging a deletion with keeping → conflict) | |
|
651 | BROKEN: this should result in conflict | |
|
652 | ||
|
653 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' | |
|
654 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
655 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' | |
|
656 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
657 | (branch merge, don't forget to commit) | |
|
658 | $ ls -1 | |
|
659 | other-file | |
|
660 | ||
|
661 | (merging two "keeping" together → no conflict) | |
|
662 | ||
|
663 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' | |
|
664 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
665 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' | |
|
666 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
667 | (branch merge, don't forget to commit) | |
|
668 | $ ls -1 | |
|
669 | other-file | |
|
670 | the-file | |
|
671 | ||
|
672 | (merging a deletion with keeping → conflict) | |
|
673 | BROKEN: this should result in conflict | |
|
674 | ||
|
675 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' | |
|
676 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
677 | $ hg merge 'desc("merge-deleted-the-file-from-deleted")' | |
|
678 | abort: empty revision set | |
|
679 | [255] | |
|
680 | $ ls -1 | |
|
681 | other-file | |
|
682 | the-file | |
|
683 | ||
|
684 | (merging a deletion with keeping → conflict) | |
|
685 | BROKEN: this should result in conflict | |
|
686 | ||
|
687 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' | |
|
688 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
689 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' | |
|
690 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
691 | (branch merge, don't forget to commit) | |
|
692 | $ ls -1 | |
|
693 | other-file |
General Comments 0
You need to be logged in to leave comments.
Login now