# HG changeset patch # User Pierre-Yves David # Date 1629832708 -7200 # Node ID 1b3c753b62c61fb362297e9a37ab733b05e7af2c # Parent 65e3d8028f2e07b77a6c56881a40805cdbba08e6 dirstate: drop the `_normal` method It only has one caller so lets inline it and cleans things up further. Differential Revision: https://phab.mercurial-scm.org/D11352 diff -r 65e3d8028f2e -r 1b3c753b62c6 mercurial/dirstate.py --- a/mercurial/dirstate.py Tue Aug 24 21:16:48 2021 +0200 +++ b/mercurial/dirstate.py Tue Aug 24 21:18:28 2021 +0200 @@ -510,7 +510,19 @@ """record that the current state of the file on disk is known to be clean""" self._dirty = True self._updatedfiles.add(filename) - self._normal(filename, parentfiledata=parentfiledata) + if parentfiledata: + (mode, size, mtime) = parentfiledata + else: + (mode, size, mtime) = self._get_filedata(filename) + self._addpath(filename, mode=mode, size=size, mtime=mtime) + self._map.copymap.pop(filename, None) + if filename in self._map.nonnormalset: + self._map.nonnormalset.remove(filename) + if mtime > self._lastnormaltime: + # Remember the most recent modification timeslot for status(), + # to make sure we won't miss future size-preserving file content + # modifications that happen within the same timeslot. + self._lastnormaltime = mtime @requires_no_parents_change def set_possibly_dirty(self, filename): @@ -705,21 +717,6 @@ mtime = s[stat.ST_MTIME] return (mode, size, mtime) - def _normal(self, f, parentfiledata=None): - if parentfiledata: - (mode, size, mtime) = parentfiledata - else: - (mode, size, mtime) = self._get_filedata(f) - self._addpath(f, mode=mode, size=size, mtime=mtime) - self._map.copymap.pop(f, None) - 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 - # modifications that happen within the same timeslot. - self._lastnormaltime = mtime - def _normallookup(self, f): '''Mark a file normal, but possibly dirty.''' if self.in_merge: