Mercurial > public > mercurial-scm > hg
comparison mercurial/branchmap.py @ 51491:54f0dd798346
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)
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 10 Mar 2024 03:32:50 +0100 |
parents | 82c1a388e86a |
children | 0c684ca692a4 |
comparison
equal
deleted
inserted
replaced
51490:82c1a388e86a | 51491:54f0dd798346 |
---|---|
106 # the cache for a subset, then extend that to add info on missing | 106 # the cache for a subset, then extend that to add info on missing |
107 # revisions. | 107 # revisions. |
108 subsetname = subsettable.get(filtername) | 108 subsetname = subsettable.get(filtername) |
109 if subsetname is not None: | 109 if subsetname is not None: |
110 subset = repo.filtered(subsetname) | 110 subset = repo.filtered(subsetname) |
111 bcache = self[subset].inherit_for(repo) | 111 self.updatecache(subset) |
112 bcache = self._per_filter[subset.filtername].inherit_for(repo) | |
112 extrarevs = subset.changelog.filteredrevs - cl.filteredrevs | 113 extrarevs = subset.changelog.filteredrevs - cl.filteredrevs |
113 revs.extend(r for r in extrarevs if r <= bcache.tiprev) | 114 revs.extend(r for r in extrarevs if r <= bcache.tiprev) |
114 else: | 115 else: |
115 # nothing to fall back on, start empty. | 116 # nothing to fall back on, start empty. |
116 bcache = branchcache(repo) | 117 bcache = branchcache(repo) |