Mercurial > hg
diff mercurial/dirstate.py @ 47990:0d2a404f1932
dirstate: introduce a set_tracked method on "map" and "item"
This move more implementation details withing the DirstateItem itself, which is
what we have been doing for a while.
Differential Revision: https://phab.mercurial-scm.org/D11430
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 15 Sep 2021 18:05:39 +0200 |
parents | 87b3010c08e0 |
children | 625b84c1abdd |
line wrap: on
line diff
--- a/mercurial/dirstate.py Wed Sep 15 11:13:46 2021 +0200 +++ b/mercurial/dirstate.py Wed Sep 15 18:05:39 2021 +0200 @@ -478,18 +478,9 @@ self._dirty = True self._updatedfiles.add(filename) entry = self._map.get(filename) - if entry is None: + if entry is None or not entry.tracked: self._check_new_tracked_filename(filename) - self._map.addfile(filename, added=True) - return True - elif not entry.tracked: - self._normallookup(filename) - return True - # XXX This is probably overkill for more case, but we need this to - # fully replace the `normallookup` call with `set_tracked` one. - # Consider smoothing this in the future. - self.set_possibly_dirty(filename) - return False + return self._map.set_tracked(filename) @requires_no_parents_change def set_untracked(self, filename):