D11076: dirstate: add dedicated function for updating data of a file

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Sun Jul 11 11:39:09 UTC 2021


marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

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

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -590,6 +590,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 calling within a `dirstate.parentchange` context.
+        """
+        self.normal(f, parentfiledata=filedata)
+
     def _addpath(
         self,
         f,



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


More information about the Mercurial-devel mailing list