Ignore tempfiles created by Mercurial VCS

Mercurial creates temporary files in the .hg directory while running
certain commands. The creation of these should not invalidate the tree
status cache for the repository.

Fixes #2206
This commit is contained in:
Benjamin Li 2022-05-23 15:04:59 -04:00
parent 8af6302c81
commit 352e31aa33
1 changed files with 5 additions and 0 deletions

View File

@ -86,3 +86,8 @@ class Repository(object):
get_func=branch_name_from_config_file,
create_watcher=self.create_watcher,
)
@staticmethod
def ignore_event(path, name):
# Ignore temporary files created during mercurial commands
return path.endswith('.hg') and name.startswith(b'tmp')