##// END OF EJS Templates
branchcache: change the _delayed flag to an explicit `_dirty` flag...
marmoute -
r52381:94f82149 default
parent child Browse files
Show More
@@ -74,7 +74,7 b' class BranchMapCache:'
74 74 disk.
75 75
76 76 If a transaction is in progress, the writing is schedule to transaction
77 close. See the `BranchMapCache.write_delayed` method.
77 close. See the `BranchMapCache.write_dirty` method.
78 78
79 79 This method exist independently of __getitem__ as it is sometime useful
80 80 to signal that we have no intend to use the data in memory yet.
@@ -164,13 +164,13 b' class BranchMapCache:'
164 164 def clear(self):
165 165 self._per_filter.clear()
166 166
167 def write_delayed(self, repo):
167 def write_dirty(self, repo):
168 168 unfi = repo.unfiltered()
169 169 for filtername in repoviewutil.get_ordered_subset():
170 170 cache = self._per_filter.get(filtername)
171 171 if cache is None:
172 172 continue
173 if cache._delayed:
173 if cache._dirty:
174 174 if filtername is None:
175 175 repo = unfi
176 176 else:
@@ -433,13 +433,13 b' class branchcache(_BaseBranchCache):'
433 433 has a given node or not. If it's not provided, we assume that every node
434 434 we have exists in changelog"""
435 435 self._filtername = repo.filtername
436 self._delayed = False
437 436 if tipnode is None:
438 437 self.tipnode = repo.nullid
439 438 else:
440 439 self.tipnode = tipnode
441 440 self.tiprev = tiprev
442 441 self.filteredhash = filteredhash
442 self._dirty = False
443 443
444 444 super().__init__(repo=repo, entries=entries, closed_nodes=closednodes)
445 445 # closednodes is a set of nodes that close their branch. If the branch
@@ -568,7 +568,7 b' class branchcache(_BaseBranchCache):'
568 568 )
569 569 # we copy will likely schedule a write anyway, but that does not seems
570 570 # to hurt to overschedule
571 other._delayed = self._delayed
571 other._dirty = self._dirty
572 572 # also copy information about the current verification state
573 573 other._verifiedbranches = set(self._verifiedbranches)
574 574 return other
@@ -583,7 +583,6 b' class branchcache(_BaseBranchCache):'
583 583 # Avoid premature writing.
584 584 #
585 585 # (The cache warming setup by localrepo will update the file later.)
586 self._delayed = True
587 586 return
588 587 try:
589 588 filename = self._filename(repo)
@@ -597,7 +596,7 b' class branchcache(_BaseBranchCache):'
597 596 len(self._entries),
598 597 nodecount,
599 598 )
600 self._delayed = False
599 self._dirty = False
601 600 except (IOError, OSError, error.Abort) as inst:
602 601 # Abort may be raised by read only opener, so log and continue
603 602 repo.ui.debug(
@@ -707,7 +706,7 b' class branchcache(_BaseBranchCache):'
707 706 self.filteredhash = scmutil.filteredhash(
708 707 repo, self.tiprev, needobsolete=True
709 708 )
710
709 self._dirty = True
711 710 self.write(repo)
712 711
713 712
@@ -2974,7 +2974,7 b' class localrepository:'
2974 2974 self._branchcaches.update_disk(filtered)
2975 2975
2976 2976 # flush all possibly delayed write.
2977 self._branchcaches.write_delayed(self)
2977 self._branchcaches.write_dirty(self)
2978 2978
2979 2979 def invalidatecaches(self):
2980 2980 if '_tagscache' in vars(self):
General Comments 0
You need to be logged in to leave comments. Login now