# HG changeset patch # User Pierre-Yves David # Date 1625180566 -7200 # Node ID 5eb65ec12465bb0019344c7c6d984db3b41a7018 # Parent 3f13dfa1fa7801bbe978a503d34db071e33bf19a dirstate: move the _rangemask filtering closer to its storage The goal is to get ready to move these kind of processing at a lower level. We start with move move _rangemask filtering close to where it is sent to the lower level to make the future move trivial. Differential Revision: https://phab.mercurial-scm.org/D10929 diff -r 3f13dfa1fa78 -r 5eb65ec12465 mercurial/dirstate.py --- a/mercurial/dirstate.py Thu Jul 01 19:15:30 2021 +0200 +++ b/mercurial/dirstate.py Fri Jul 02 01:02:46 2021 +0200 @@ -455,6 +455,10 @@ msg = _(b'file %r in dirstate clashes with %r') msg %= (pycompat.bytestr(d), pycompat.bytestr(f)) raise error.Abort(msg) + if size != NONNORMAL and size != FROM_P2: + size = size & _rangemask + if mtime != AMBIGUOUS_TIME: + mtime = mtime & _rangemask self._dirty = True self._updatedfiles.add(f) self._map.addfile(f, oldstate, state, mode, size, mtime) @@ -476,7 +480,7 @@ mode = s.st_mode size = s.st_size mtime = s[stat.ST_MTIME] - self._addpath(f, b'n', mode, size & _rangemask, mtime & _rangemask) + self._addpath(f, b'n', mode, size, mtime) self._map.copymap.pop(f, None) if f in self._map.nonnormalset: self._map.nonnormalset.remove(f)