From patchwork Tue Nov 24 22:02:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2, of, 6, mergedriver] mergestate: explicitly forget 'dc' conflicts where the deleted side is picked From: Siddharth Agarwal X-Patchwork-Id: 11611 Message-Id: To: Date: Tue, 24 Nov 2015 14:02:37 -0800 # HG changeset patch # User Siddharth Agarwal # Date 1448330605 28800 # Mon Nov 23 18:03:25 2015 -0800 # Node ID f959d838869ced41c19dbcc1c0abd936cc84b972 # Parent 4adc3f379dc67ac23d5377206b3179ebe5099765 # Available At http://42.netv6.net/sid0-wip/hg/ # hg pull http://42.netv6.net/sid0-wip/hg/ -r f959d838869c 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"))