##// END OF EJS Templates
merge: pass mergeresult obj instead of actions dict in _resolvetrivial()...
Pulkit Goyal -
r45843:00e9c5ed default
parent child Browse files
Show More
@@ -959,26 +959,28 b' def manifestmerge('
959 return mresult
959 return mresult
960
960
961
961
962 def _resolvetrivial(repo, wctx, mctx, ancestor, actions):
962 def _resolvetrivial(repo, wctx, mctx, ancestor, mresult):
963 """Resolves false conflicts where the nodeid changed but the content
963 """Resolves false conflicts where the nodeid changed but the content
964 remained the same."""
964 remained the same."""
965 # We force a copy of actions.items() because we're going to mutate
965 # We force a copy of actions.items() because we're going to mutate
966 # actions as we resolve trivial conflicts.
966 # actions as we resolve trivial conflicts.
967 for f, (m, args, msg) in list(actions.items()):
967 for f, (m, args, msg) in list(mresult.actions.items()):
968 if (
968 if (
969 m == mergestatemod.ACTION_CHANGED_DELETED
969 m == mergestatemod.ACTION_CHANGED_DELETED
970 and f in ancestor
970 and f in ancestor
971 and not wctx[f].cmp(ancestor[f])
971 and not wctx[f].cmp(ancestor[f])
972 ):
972 ):
973 # local did change but ended up with same content
973 # local did change but ended up with same content
974 actions[f] = mergestatemod.ACTION_REMOVE, None, b'prompt same'
974 mresult.addfile(
975 f, mergestatemod.ACTION_REMOVE, None, b'prompt same'
976 )
975 elif (
977 elif (
976 m == mergestatemod.ACTION_DELETED_CHANGED
978 m == mergestatemod.ACTION_DELETED_CHANGED
977 and f in ancestor
979 and f in ancestor
978 and not mctx[f].cmp(ancestor[f])
980 and not mctx[f].cmp(ancestor[f])
979 ):
981 ):
980 # remote did change but ended up with same content
982 # remote did change but ended up with same content
981 del actions[f] # don't get = keep local deleted
983 mresult.removefile(f) # don't get = keep local deleted
982
984
983
985
984 def calculateupdates(
986 def calculateupdates(
@@ -1127,7 +1129,7 b' def calculateupdates('
1127 prunedactions = sparse.filterupdatesactions(
1129 prunedactions = sparse.filterupdatesactions(
1128 repo, wctx, mctx, branchmerge, mresult.actions
1130 repo, wctx, mctx, branchmerge, mresult.actions
1129 )
1131 )
1130 _resolvetrivial(repo, wctx, mctx, ancestors[0], mresult.actions)
1132 _resolvetrivial(repo, wctx, mctx, ancestors[0], mresult)
1131
1133
1132 mresult.setactions(prunedactions)
1134 mresult.setactions(prunedactions)
1133 return mresult
1135 return mresult
General Comments 0
You need to be logged in to leave comments. Login now