dirstate: add dedicated function for updating data of a file
authorPulkit Goyal <7895pulkit@gmail.com>
Fri, 09 Jul 2021 15:27:38 +0530
changeset 47612 a9d75262b992
parent 47611 e2e72daac90b
child 47613 8b16ccc71001
dirstate: add dedicated function for updating data of a file `dirstate.normal()` is too generic to be a user facing function for that. This is a part of effort to refactor dirstate APIs and make them clearer. Differential Revision: https://phab.mercurial-scm.org/D11076
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed Jul 07 19:36:14 2021 +0200
+++ b/mercurial/dirstate.py	Fri Jul 09 15:27:38 2021 +0530
@@ -593,6 +593,14 @@
         else:
             assert False, 'unreachable'
 
+    @requires_parents_change
+    def update_parent_file_data(self, f, filedata):
+        """update the information about the content of a file
+
+        This function should be called within a `dirstate.parentchange` context.
+        """
+        self.normal(f, parentfiledata=filedata)
+
     def _addpath(
         self,
         f,