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