# HG changeset patch # User Siddharth Agarwal # Date 2015-11-24 02:03:25 # Node ID 77d760ba8dcd59ddbc83ba9a12fd152a1fb9208e # Parent b08c31cfc4b6c749cd00f78b249efc577527823f mergestate: explicitly forget 'dc' conflicts where the deleted side is picked Once we move change/delete conflicts into the resolve phase, a 'dc' file might first be resolved by picking the other side, then later be resolved by picking the local side. For this transition we want to make sure that the file goes back to not being in the dirstate. This has no impact on conflicts during the initial merge. diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -458,10 +458,13 @@ class mergestate(object): if complete: action = None if deleted: - if not fcd.isabsent(): + if fcd.isabsent(): + # dc: local picked. Need to drop if present, which may + # happen on re-resolves. + action = 'f' + else: # cd: remote picked (or otherwise deleted) action = 'r' - # else: dc: local picked (no action necessary) else: if fcd.isabsent(): # dc: remote picked action = 'g' @@ -511,7 +514,7 @@ class mergestate(object): def actions(self): """return lists of actions to perform on the dirstate""" - actions = {'r': [], 'a': [], 'g': []} + actions = {'r': [], 'f': [], 'a': [], 'g': []} for f, (r, action) in self._results.iteritems(): if action is not None: actions[action].append((f, None, "merge result"))