# HG changeset patch # User Pierre-Yves David # Date 1511585216 18000 # Node ID 35c79686a6359b9c06a4883d2d8273c6a85989d1 # Parent 3ccde4699cf05a02d191f74fc50ba98750fb2c96 serverminitopic: also avoid reading Avoiding to write cache for filter where topic applies is a good step, but we need to also avoid reading it. Existing branchmap cache might exists before the turned the feature on. diff -r 3ccde4699cf0 -r 35c79686a635 hgext3rd/serverminitopic.py --- a/hgext3rd/serverminitopic.py Wed Nov 15 08:00:17 2017 +0100 +++ b/hgext3rd/serverminitopic.py Fri Nov 24 23:46:56 2017 -0500 @@ -189,6 +189,14 @@ if mighttopic(repo): self.phaseshash = _phaseshash(repo, self.tiprev) +def wrapread(orig, repo): + # Avoiding to write cache for filter where topic applies is a good step, + # but we need to also avoid reading it. Existing branchmap cache might + # exists before the turned the feature on. + if mighttopic(repo): + return None + return orig(repo) + # advertise topic capabilities def wireprotocaps(orig, repo, proto): @@ -214,4 +222,5 @@ def uisetup(ui): wrapclass(context, 'changectx', topicchangectx) wrapclass(branchmap, 'branchcache', _topiccache) + extensions.wrapfunction(branchmap, 'read', wrapread) extensions.wrapfunction(wireproto, '_capabilities', wireprotocaps)