changeset 50041:1346db77e14d

dirstate: use the `changing_files` context in the `keyword` demo This is the way.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 25 Jan 2023 12:46:46 +0100
parents d41960df197e
children 237e9d2e1c71
files hgext/keyword.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Wed Jan 25 12:56:26 2023 +0100
+++ b/hgext/keyword.py	Wed Jan 25 12:46:46 2023 +0100
@@ -532,7 +532,8 @@
     keywords = b'$' + b'$\n$'.join(sorted(kwmaps.keys())) + b'$\n'
     repo.wvfs.write(fn, keywords)
     with repo.wlock():
-        repo[None].add([fn])
+        with repo.dirstate.changing_files(repo):
+            repo[None].add([fn])
         ui.note(_(b'\nkeywords written to %s:\n') % fn)
         ui.note(keywords)
         repo.dirstate.setbranch(b'demobranch')