diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
index 1a9bdd0e1c444df10e233b047a120e2b869e4088_bWVyY3VyaWFsL2JyYW5jaG1hcC5weQ==..94f821490645e0825ebc01e8574e46ab803a4289_bWVyY3VyaWFsL2JyYW5jaG1hcC5weQ== 100644
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -74,7 +74,7 @@
         disk.
 
         If a transaction is in progress, the writing is schedule to transaction
-        close. See the `BranchMapCache.write_delayed` method.
+        close. See the `BranchMapCache.write_dirty` method.
 
         This method exist independently of __getitem__ as it is sometime useful
         to signal that we have no intend to use the data in memory yet.
@@ -164,9 +164,9 @@
     def clear(self):
         self._per_filter.clear()
 
-    def write_delayed(self, repo):
+    def write_dirty(self, repo):
         unfi = repo.unfiltered()
         for filtername in repoviewutil.get_ordered_subset():
             cache = self._per_filter.get(filtername)
             if cache is None:
                 continue
@@ -168,9 +168,9 @@
         unfi = repo.unfiltered()
         for filtername in repoviewutil.get_ordered_subset():
             cache = self._per_filter.get(filtername)
             if cache is None:
                 continue
-            if cache._delayed:
+            if cache._dirty:
                 if filtername is None:
                     repo = unfi
                 else:
@@ -433,10 +433,9 @@
         has a given node or not. If it's not provided, we assume that every node
         we have exists in changelog"""
         self._filtername = repo.filtername
-        self._delayed = False
         if tipnode is None:
             self.tipnode = repo.nullid
         else:
             self.tipnode = tipnode
         self.tiprev = tiprev
         self.filteredhash = filteredhash
@@ -437,9 +436,10 @@
         if tipnode is None:
             self.tipnode = repo.nullid
         else:
             self.tipnode = tipnode
         self.tiprev = tiprev
         self.filteredhash = filteredhash
+        self._dirty = False
 
         super().__init__(repo=repo, entries=entries, closed_nodes=closednodes)
         # closednodes is a set of nodes that close their branch. If the branch
@@ -568,7 +568,7 @@
         )
         # we copy will likely schedule a write anyway, but that does not seems
         # to hurt to overschedule
-        other._delayed = self._delayed
+        other._dirty = self._dirty
         # also copy information about the current verification state
         other._verifiedbranches = set(self._verifiedbranches)
         return other
@@ -583,7 +583,6 @@
             # Avoid premature writing.
             #
             # (The cache warming setup by localrepo will update the file later.)
-            self._delayed = True
             return
         try:
             filename = self._filename(repo)
@@ -597,7 +596,7 @@
                 len(self._entries),
                 nodecount,
             )
-            self._delayed = False
+            self._dirty = False
         except (IOError, OSError, error.Abort) as inst:
             # Abort may be raised by read only opener, so log and continue
             repo.ui.debug(
@@ -707,7 +706,7 @@
         self.filteredhash = scmutil.filteredhash(
             repo, self.tiprev, needobsolete=True
         )
-
+        self._dirty = True
         self.write(repo)
 
 
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
index 1a9bdd0e1c444df10e233b047a120e2b869e4088_bWVyY3VyaWFsL2xvY2FscmVwby5weQ==..94f821490645e0825ebc01e8574e46ab803a4289_bWVyY3VyaWFsL2xvY2FscmVwby5weQ== 100644
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2974,7 +2974,7 @@
                 self._branchcaches.update_disk(filtered)
 
         # flush all possibly delayed write.
-        self._branchcaches.write_delayed(self)
+        self._branchcaches.write_dirty(self)
 
     def invalidatecaches(self):
         if '_tagscache' in vars(self):