Mercurial > hg
diff mercurial/pure/parsers.py @ 48060:a660d8a53267
dirstate: use a new `drop_merge_data` in `setparent`
What is happening in this `setparent` loop is that we remove all `merge`
related information when the dirstate is moved out of a `merge` situation.
So instead of shuffling state to get them where we want, we simply add a method
on the DirstateItem to do drop the information we want dropped.
Differential Revision: https://phab.mercurial-scm.org/D11506
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 22 Sep 2021 17:46:29 +0200 |
parents | 0d2a404f1932 |
children | 060cd909439f |
line wrap: on
line diff
--- a/mercurial/pure/parsers.py Wed Sep 22 15:17:12 2021 +0200 +++ b/mercurial/pure/parsers.py Wed Sep 22 17:46:29 2021 +0200 @@ -263,6 +263,24 @@ self._size = None self._mtime = None + def drop_merge_data(self): + """remove all "merge-only" from a DirstateItem + + This is to be call by the dirstatemap code when the second parent is dropped + """ + if not (self.merged or self.from_p2): + return + self._p1_tracked = self.merged # why is this not already properly set ? + + self._merged = False + self._clean_p1 = False + self._clean_p2 = False + self._p2_tracked = False + self._possibly_dirty = True + self._mode = None + self._size = None + self._mtime = None + @property def mode(self): return self.v1_mode()