branchcache: do not use `__getitem__` in updatecache
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 10 Mar 2024 03:32:50 +0100
changeset 51494 54f0dd798346
parent 51493 82c1a388e86a
child 51495 0c684ca692a4
branchcache: do not use `__getitem__` in updatecache The `update_disk` method uses `updatecache` and the point of `update_disk` is to be able to do alternative processing to the one we do in `__getitem__`. So we calling `__getitem__` in `updatecache` defeat this purpose. Instead we do the equivalent explicitly to preserve the spirit of `update_disk` (that we will actually put to use soon, I promise)
mercurial/branchmap.py
--- a/mercurial/branchmap.py	Sun Mar 10 05:10:00 2024 +0100
+++ b/mercurial/branchmap.py	Sun Mar 10 03:32:50 2024 +0100
@@ -108,7 +108,8 @@
             subsetname = subsettable.get(filtername)
             if subsetname is not None:
                 subset = repo.filtered(subsetname)
-                bcache = self[subset].inherit_for(repo)
+                self.updatecache(subset)
+                bcache = self._per_filter[subset.filtername].inherit_for(repo)
                 extrarevs = subset.changelog.filteredrevs - cl.filteredrevs
                 revs.extend(r for r in extrarevs if r <= bcache.tiprev)
             else: