##// END OF EJS Templates
merge: add `ACTION_KEEP_ABSENT` to represent files we want to keep absent...
Pulkit Goyal -
r46039:bb9888d3 default
parent child Browse files
Show More
@@ -563,7 +563,10 b' class mergeresult(object):'
563 563 It has information about what actions need to be performed on dirstate
564 564 mapping of divergent renames and other such cases. '''
565 565
566 NO_OP_ACTIONS = (mergestatemod.ACTION_KEEP,)
566 NO_OP_ACTIONS = (
567 mergestatemod.ACTION_KEEP,
568 mergestatemod.ACTION_KEEP_ABSENT,
569 )
567 570
568 571 def __init__(self):
569 572 """
@@ -1176,6 +1179,11 b' def calculateupdates('
1176 1179 repo.ui.note(_(b" %s: picking 'keep' action\n") % f)
1177 1180 mresult.addfile(f, *bids[mergestatemod.ACTION_KEEP][0])
1178 1181 continue
1182 # If keep absent is an option, just do that
1183 if mergestatemod.ACTION_KEEP_ABSENT in bids:
1184 repo.ui.note(_(b" %s: picking 'keep absent' action\n") % f)
1185 mresult.addfile(f, *bids[mergestatemod.ACTION_KEEP_ABSENT][0])
1186 continue
1179 1187 # If there are gets and they all agree [how could they not?], do it.
1180 1188 if mergestatemod.ACTION_GET in bids:
1181 1189 ga0 = bids[mergestatemod.ACTION_GET][0]
@@ -1530,6 +1538,11 b' def applyupdates('
1530 1538 ):
1531 1539 repo.ui.debug(b" %s: %s -> k\n" % (f, msg))
1532 1540 # no progress
1541 for f, args, msg in mresult.getactions(
1542 (mergestatemod.ACTION_KEEP_ABSENT,), sort=True
1543 ):
1544 repo.ui.debug(b" %s: %s -> ka\n" % (f, msg))
1545 # no progress
1533 1546
1534 1547 # directory rename, move local
1535 1548 for f, args, msg in mresult.getactions(
@@ -120,6 +120,10 b" ACTION_MERGE = b'm'"
120 120 ACTION_LOCAL_DIR_RENAME_GET = b'dg'
121 121 ACTION_DIR_RENAME_MOVE_LOCAL = b'dm'
122 122 ACTION_KEEP = b'k'
123 # the file was absent on local side before merge and we should
124 # keep it absent (absent means file not present, it can be a result
125 # of file deletion, rename etc.)
126 ACTION_KEEP_ABSENT = b'ka'
123 127 ACTION_EXEC = b'e'
124 128 ACTION_CREATED_MERGE = b'cm'
125 129
@@ -837,6 +841,10 b' def recordupdates(repo, actions, branchm'
837 841 for f, args, msg in actions.get(ACTION_KEEP, []):
838 842 pass
839 843
844 # keep deleted
845 for f, args, msg in actions.get(ACTION_KEEP_ABSENT, []):
846 pass
847
840 848 # get
841 849 for f, args, msg in actions.get(ACTION_GET, []):
842 850 if branchmerge:
General Comments 0
You need to be logged in to leave comments. Login now