[PATCH 2 of 6 mergedriver] mergestate: explicitly forget 'dc' conflicts where the deleted side is picked
Martin von Zweigbergk
martinvonz at google.com
Sat Nov 28 00:14:52 CST 2015
On Tue, Nov 24, 2015 at 2:04 PM Siddharth Agarwal <sid0 at fb.com> wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0 at fb.com>
> # 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'
>
Does 'f' stand for 'forget'? Will the file also be removed if it exists, or
will it just become untracked (eventually, when this feature is done))?
> + 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"))
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151128/99d65b60/attachment.html>
More information about the Mercurial-devel
mailing list