Mercurial > hg
comparison mercurial/vfs.py @ 47443:9ab54aa56982
vfs: add a `register_file` method on the vfs class
This is used by the fncache vfs to register new file. Until now, `fncache` have
been doing this "automatically" by monitoring write pattern. However this is
fragile and when we copy files in place by other means, we need something more
robuts. So we add an explicit method to do so.
Differential Revision: https://phab.mercurial-scm.org/D10851
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 08 Jun 2021 02:05:05 +0200 |
parents | 63286e0886a6 |
children | 98c3fa6a3ac2 |
comparison
equal
deleted
inserted
replaced
47442:d1c1fd7ac46d | 47443:9ab54aa56982 |
---|---|
326 yield bfc | 326 yield bfc |
327 finally: | 327 finally: |
328 vfs._backgroundfilecloser = ( | 328 vfs._backgroundfilecloser = ( |
329 None # pytype: disable=attribute-error | 329 None # pytype: disable=attribute-error |
330 ) | 330 ) |
331 | |
332 def register_file(self, path): | |
333 """generic hook point to lets fncache steer its stew""" | |
331 | 334 |
332 | 335 |
333 class vfs(abstractvfs): | 336 class vfs(abstractvfs): |
334 """Operate files relative to a base directory | 337 """Operate files relative to a base directory |
335 | 338 |