From 352e31aa33ece4a94f7d724fdf6c2d350f8fa609 Mon Sep 17 00:00:00 2001 From: Benjamin Li Date: Mon, 23 May 2022 15:04:59 -0400 Subject: [PATCH] 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 --- powerline/lib/vcs/mercurial.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/powerline/lib/vcs/mercurial.py b/powerline/lib/vcs/mercurial.py index 09b6e0b1..2006c2a4 100644 --- a/powerline/lib/vcs/mercurial.py +++ b/powerline/lib/vcs/mercurial.py @@ -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')