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

login
register
mail settings
Submitter phabricator
Date July 11, 2021, 11:39 a.m.
Message ID <differential-rev-PHID-DREV-tdpyqbi3papcokp4u6cy-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49390/
State Superseded
Headers show

Comments

phabricator - July 11, 2021, 11:39 a.m.
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




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

Patch

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,