dirstate: avoid unnecessary calculation with treestate

Summary:
With treestate, nonnormalset and otherparentset no longer need separate
maintenance, since they are always calculated from the source of truth.

Reviewed By: phillco

Differential Revision: D8498996

fbshipit-source-id: a9d52f0cbbf2049dc873ca5ab83420a436408f36
This commit is contained in:
Jun Wu 2018-06-18 13:53:08 -07:00 committed by Facebook Github Bot
parent 45801f1f5f
commit 075a9c4cc0

View File

@ -474,8 +474,8 @@ class dirstate(object):
self._addpath(f, "n", s.st_mode, s.st_size & _rangemask, mtime & _rangemask)
if not self._istreestate:
self._map.copymap.pop(f, None)
if f in self._map.nonnormalset:
self._map.nonnormalset.remove(f)
if f in self._map.nonnormalset:
self._map.nonnormalset.remove(f)
if mtime > self._lastnormaltime:
# Remember the most recent modification timeslot for status(),
# to make sure we won't miss future size-preserving file content
@ -539,7 +539,8 @@ class dirstate(object):
size = -1
elif entry[0] == "n" and entry[2] == -2: # other parent
size = -2
self._map.otherparentset.add(f)
if not self._istreestate:
self._map.otherparentset.add(f)
self._updatedfiles.add(f)
self._map.removefile(f, oldstate, size)
if not self._istreestate: