##// END OF EJS Templates
mergestate: introduce a new ACTION_KEEP_NEW...
Pulkit Goyal -
r46095:6877b0ee default
parent child Browse files
Show More
@@ -552,6 +552,7 b' class mergeresult(object):'
552 552 NO_OP_ACTIONS = (
553 553 mergestatemod.ACTION_KEEP,
554 554 mergestatemod.ACTION_KEEP_ABSENT,
555 mergestatemod.ACTION_KEEP_NEW,
555 556 )
556 557
557 558 def __init__(self):
@@ -921,7 +922,7 b' def manifestmerge('
921 922 else: # file not in ancestor, not in remote
922 923 mresult.addfile(
923 924 f,
924 mergestatemod.ACTION_KEEP,
925 mergestatemod.ACTION_KEEP_NEW,
925 926 None,
926 927 b'ancestor missing, remote missing',
927 928 )
@@ -1191,6 +1192,11 b' def calculateupdates('
1191 1192 repo.ui.note(_(b" %s: picking 'keep absent' action\n") % f)
1192 1193 mresult.addfile(f, *bids[mergestatemod.ACTION_KEEP_ABSENT][0])
1193 1194 continue
1195 # If keep new is an option, let's just do that
1196 if mergestatemod.ACTION_KEEP_NEW in bids:
1197 repo.ui.note(_(b" %s: picking 'keep new' action\n") % f)
1198 mresult.addfile(f, *bids[mergestatemod.ACTION_KEEP_NEW][0])
1199 continue
1194 1200 # If there are gets and they all agree [how could they not?], do it.
1195 1201 if mergestatemod.ACTION_GET in bids:
1196 1202 ga0 = bids[mergestatemod.ACTION_GET][0]
@@ -1496,16 +1502,10 b' def applyupdates('
1496 1502 progress.increment(item=f)
1497 1503
1498 1504 # keep (noop, just log it)
1499 for f, args, msg in mresult.getactions(
1500 (mergestatemod.ACTION_KEEP,), sort=True
1501 ):
1502 repo.ui.debug(b" %s: %s -> k\n" % (f, msg))
1503 # no progress
1504 for f, args, msg in mresult.getactions(
1505 (mergestatemod.ACTION_KEEP_ABSENT,), sort=True
1506 ):
1507 repo.ui.debug(b" %s: %s -> ka\n" % (f, msg))
1508 # no progress
1505 for a in mergeresult.NO_OP_ACTIONS:
1506 for f, args, msg in mresult.getactions((a,), sort=True):
1507 repo.ui.debug(b" %s: %s -> %s\n" % (f, msg, a))
1508 # no progress
1509 1509
1510 1510 # directory rename, move local
1511 1511 for f, args, msg in mresult.getactions(
@@ -117,6 +117,9 b" ACTION_KEEP = b'k'"
117 117 # keep it absent (absent means file not present, it can be a result
118 118 # of file deletion, rename etc.)
119 119 ACTION_KEEP_ABSENT = b'ka'
120 # the file is absent on the ancestor and remote side of the merge
121 # hence this file is new and we should keep it
122 ACTION_KEEP_NEW = b'kn'
120 123 ACTION_EXEC = b'e'
121 124 ACTION_CREATED_MERGE = b'cm'
122 125
@@ -767,6 +770,10 b' def recordupdates(repo, actions, branchm'
767 770 for f, args, msg in actions.get(ACTION_KEEP_ABSENT, []):
768 771 pass
769 772
773 # keep new
774 for f, args, msg in actions.get(ACTION_KEEP_NEW, []):
775 pass
776
770 777 # get
771 778 for f, args, msg in actions.get(ACTION_GET, []):
772 779 if branchmerge:
@@ -431,8 +431,8 b' Verify that the old context ancestor wor'
431 431 resolving manifests
432 432 branchmerge: True, force: False, partial: False
433 433 ancestor: 11b5b303e36c, local: c0ef19750a22+, remote: 6ca01f7342b9
434 d1/a: ancestor missing, remote missing -> k
435 d1/b: ancestor missing, remote missing -> k
434 d1/a: ancestor missing, remote missing -> kn
435 d1/b: ancestor missing, remote missing -> kn
436 436 d2/b: remote created -> g
437 437
438 438 calculating bids for ancestor 154e6000f54e
@@ -452,13 +452,13 b' Verify that the old context ancestor wor'
452 452
453 453 auction for merging merge bids (2 ancestors)
454 454 list of bids for d1/a:
455 ancestor missing, remote missing -> k
455 ancestor missing, remote missing -> kn
456 456 other deleted -> r
457 d1/a: picking 'keep' action
457 d1/a: picking 'keep new' action
458 458 list of bids for d1/b:
459 ancestor missing, remote missing -> k
459 ancestor missing, remote missing -> kn
460 460 other deleted -> r
461 d1/b: picking 'keep' action
461 d1/b: picking 'keep new' action
462 462 list of bids for d2/b:
463 463 remote created -> g
464 464 remote created -> g
@@ -467,8 +467,8 b' Verify that the old context ancestor wor'
467 467
468 468 d2/b: remote created -> g
469 469 getting d2/b
470 d1/a: ancestor missing, remote missing -> k
471 d1/b: ancestor missing, remote missing -> k
470 d1/a: ancestor missing, remote missing -> kn
471 d1/b: ancestor missing, remote missing -> kn
472 472 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
473 473 (branch merge, don't forget to commit)
474 474
General Comments 0
You need to be logged in to leave comments. Login now