comparison 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
comparison
equal deleted inserted replaced
48384:9f1b9e128788 48385:080151f18f3a
255 for x in self.git.index: 255 for x in self.git.index:
256 p = pycompat.fsencode(x.path) 256 p = pycompat.fsencode(x.path)
257 if match(p): 257 if match(p):
258 yield p 258 yield p
259 259
260 def set_clean(self, f, parentfiledata=None): 260 def set_clean(self, f, parentfiledata):
261 """Mark a file normal and clean.""" 261 """Mark a file normal and clean."""
262 # TODO: for now we just let libgit2 re-stat the file. We can 262 # TODO: for now we just let libgit2 re-stat the file. We can
263 # clearly do better. 263 # clearly do better.
264 264
265 def set_possibly_dirty(self, f): 265 def set_possibly_dirty(self, f):