comparison mercurial/hook.py @ 50325:2761ce777fc4 stable

hooks: invalidate the repo after the hooks Since the hooks may have changed the repository content it seems safer to invalidate it. The invalidation is "soft", the data are kept around and few work will be needed to restore them if nothing actually changed.
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Thu, 23 Mar 2023 11:36:25 +0000
parents f254fc73d956
children c642c03969ff
comparison
equal deleted inserted replaced
50324:e6532a7336d0 50325:2761ce777fc4
189 cwd = repo.root 189 cwd = repo.root
190 else: 190 else:
191 cwd = encoding.getcwd() 191 cwd = encoding.getcwd()
192 r = ui.system(cmd, environ=env, cwd=cwd, blockedtag=b'exthook-%s' % (name,)) 192 r = ui.system(cmd, environ=env, cwd=cwd, blockedtag=b'exthook-%s' % (name,))
193 193
194 if repo is not None and repo.currentwlock() is None:
195 repo.invalidatedirstate()
196 if repo is not None and repo.currentlock() is None:
197 repo.invalidate()
198
194 duration = util.timer() - starttime 199 duration = util.timer() - starttime
195 ui.log( 200 ui.log(
196 b'exthook', 201 b'exthook',
197 b'exthook-%s: %s finished in %0.2f seconds\n', 202 b'exthook-%s: %s finished in %0.2f seconds\n',
198 name, 203 name,