Mercurial > hg
diff mercurial/dirstate.py @ 47516:b8ffe85e399b
dirstate-entry: `merged_removed` and `from_p2_removed` properties
Lets start to define and use more semantic property. These two might be a bit
too low level and could be shaved off later, however this seems an improvement
for now.
Differential Revision: https://phab.mercurial-scm.org/D10958
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 03 Jul 2021 20:34:09 +0200 |
parents | c94d3ff46fd5 |
children | 28632eb3ca3e |
line wrap: on
line diff
--- a/mercurial/dirstate.py Sat Jul 03 04:18:54 2021 +0200 +++ b/mercurial/dirstate.py Sat Jul 03 20:34:09 2021 +0200 @@ -531,16 +531,18 @@ # being removed, restore that state. entry = self._map.get(f) if entry is not None: - if entry.removed and (entry[2] == NONNORMAL or entry.from_p2): + # XXX this should probably be dealt with a a lower level + # (see `merged_removed` and `from_p2_removed`) + if entry.merged_removed or entry.from_p2_removed: source = self._map.copymap.get(f) - if entry[2] == NONNORMAL: + if entry.merged_removed: self.merge(f) - elif entry.from_p2: + elif entry.from_p2_removed: self.otherparent(f) - if source: + if source is not None: self.copy(source, f) return - if entry.merged or entry.state == b'n' and entry.from_p2: + elif entry.merged or entry.state == b'n' and entry.from_p2: return self._addpath(f, b'n', 0, possibly_dirty=True) self._map.copymap.pop(f, None)