mercurial/bookmarks.py
branchstable
changeset 48796 c00d3ce4e94b
parent 48685 21ac6aedd5e5
child 48875 6000f5b25c9b
--- a/mercurial/bookmarks.py	Fri Feb 18 12:55:39 2022 +0100
+++ b/mercurial/bookmarks.py	Fri Feb 18 14:27:43 2022 +0100
@@ -22,6 +22,7 @@
     error,
     obsutil,
     pycompat,
+    requirements,
     scmutil,
     txnutil,
     util,
@@ -36,11 +37,9 @@
 # custom styles
 activebookmarklabel = b'bookmarks.active bookmarks.current'
 
-BOOKMARKS_IN_STORE_REQUIREMENT = b'bookmarksinstore'
-
 
 def bookmarksinstore(repo):
-    return BOOKMARKS_IN_STORE_REQUIREMENT in repo.requirements
+    return requirements.BOOKMARKS_IN_STORE_REQUIREMENT in repo.requirements
 
 
 def bookmarksvfs(repo):
@@ -213,7 +212,11 @@
         The transaction is then responsible for updating the file content."""
         location = b'' if bookmarksinstore(self._repo) else b'plain'
         tr.addfilegenerator(
-            b'bookmarks', (b'bookmarks',), self._write, location=location
+            b'bookmarks',
+            (b'bookmarks',),
+            self._write,
+            location=location,
+            post_finalize=True,
         )
         tr.hookargs[b'bookmark_moved'] = b'1'