diff hgext/git/dirstate.py @ 48385:080151f18f3a

dirstate: make it mandatory to provide parentfiledata in `set_clean` Gathering the mode, size and mtime, independently from determining that the file is clean is a race-machine. So we just make these information required arguments. (note that the data is still gathered in a racy way in practice, but at least the API is no longer encouraging it.) Differential Revision: https://phab.mercurial-scm.org/D11789
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 17 Nov 2021 20:26:14 +0100
parents 0bdcb5ef932c
children 6000f5b25c9b
line wrap: on
line diff
--- a/hgext/git/dirstate.py	Mon Nov 22 15:58:51 2021 +0100
+++ b/hgext/git/dirstate.py	Wed Nov 17 20:26:14 2021 +0100
@@ -257,7 +257,7 @@
             if match(p):
                 yield p
 
-    def set_clean(self, f, parentfiledata=None):
+    def set_clean(self, f, parentfiledata):
         """Mark a file normal and clean."""
         # TODO: for now we just let libgit2 re-stat the file. We can
         # clearly do better.