# HG changeset patch # User Pierre-Yves David # Date 2021-10-01 02:04:38 # Node ID e2753a7acfa78f651ac1a372ea5605610221eefc # Parent 142e9f0a70b5a756993fdc89ff0f3c99e5ed5d6f dirstate-item: use the `p2_info` property to replace more verbose call Differential Revision: https://phab.mercurial-scm.org/D11592 diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -1372,7 +1372,7 @@ class dirstate(object): if not st and t.tracked: dadd(fn) - elif t.merged or t.from_p2: + elif t.p2_info: madd(fn) elif t.added: aadd(fn) diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py --- a/mercurial/dirstatemap.py +++ b/mercurial/dirstatemap.py @@ -332,7 +332,7 @@ class dirstatemap(_dirstatemapcommon): if fold_p2: for f, s in pycompat.iteritems(self._map): # Discard "merged" markers when moving away from a merge state - if s.merged or s.from_p2: + if s.p2_info: source = self.copymap.pop(f, None) if source: copies[f] = source @@ -604,7 +604,7 @@ if rustmod is not None: # enables in-place mutation of elements of a collection while # iterating it, without mutating the collection itself. files_with_p2_info = [ - f for f, s in self._map.items() if s.merged or s.from_p2 + f for f, s in self._map.items() if s.p2_info ] rust_map = self._map for f in files_with_p2_info: