changeset 47612:a9d75262b992

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
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 09 Jul 2021 15:27:38 +0530
parents e2e72daac90b
children 8b16ccc71001
files mercurial/dirstate.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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,