Patchwork D10929: dirstate: move the _rangemask filtering closer to its storage

login
register
mail settings
Submitter phabricator
Date July 2, 2021, 3:18 p.m.
Message ID <differential-rev-PHID-DREV-zi5eifotgrut2jpyczdz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49243/
State Superseded
Headers show

Comments

phabricator - July 2, 2021, 3:18 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10929

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -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)