hgext3rd/serverminitopic.py
changeset 3207 35c79686a635
parent 3206 3ccde4699cf0
child 3511 768f752b5364
--- 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)