dirstate: drop the `_normal` method
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 24 Aug 2021 21:18:28 +0200
changeset 47917 1b3c753b62c6
parent 47916 65e3d8028f2e
child 47918 496a8e383aeb
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
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: