Mercurial > hg > mercurial-source
comparison mercurial/repoview.py @ 24209:a41902aac76d stable
repoview: invalidate cached changelog if _delayed changes (issue4549)
Starting with 2d54aa5397cd, when a clone reached the checkout stage,
the cached changelog in the filtered view was still seeing the
_delayed flag, even though the changelog had already been finalized.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 01 Mar 2015 23:20:02 -0600 |
parents | ab3b8d8fd2a0 |
children | 2f7cb6e6acdd |
comparison
equal
deleted
inserted
replaced
24208:f7401f816cc9 | 24209:a41902aac76d |
---|---|
272 # some cache may be implemented later | 272 # some cache may be implemented later |
273 unfi = self._unfilteredrepo | 273 unfi = self._unfilteredrepo |
274 unfichangelog = unfi.changelog | 274 unfichangelog = unfi.changelog |
275 revs = filterrevs(unfi, self.filtername) | 275 revs = filterrevs(unfi, self.filtername) |
276 cl = self._clcache | 276 cl = self._clcache |
277 newkey = (len(unfichangelog), unfichangelog.tip(), hash(revs)) | 277 newkey = (len(unfichangelog), unfichangelog.tip(), hash(revs), |
278 unfichangelog._delayed) | |
278 if cl is not None: | 279 if cl is not None: |
279 # we need to check curkey too for some obscure reason. | 280 # we need to check curkey too for some obscure reason. |
280 # MQ test show a corruption of the underlying repo (in _clcache) | 281 # MQ test show a corruption of the underlying repo (in _clcache) |
281 # without change in the cachekey. | 282 # without change in the cachekey. |
282 oldfilter = cl.filteredrevs | 283 oldfilter = cl.filteredrevs |
283 try: | 284 try: |
284 cl.filteredrevs = () # disable filtering for tip | 285 cl.filteredrevs = () # disable filtering for tip |
285 curkey = (len(cl), cl.tip(), hash(oldfilter)) | 286 curkey = (len(cl), cl.tip(), hash(oldfilter), cl._delayed) |
286 finally: | 287 finally: |
287 cl.filteredrevs = oldfilter | 288 cl.filteredrevs = oldfilter |
288 if newkey != self._clcachekey or newkey != curkey: | 289 if newkey != self._clcachekey or newkey != curkey: |
289 cl = None | 290 cl = None |
290 # could have been made None by the previous if | 291 # could have been made None by the previous if |