topic: only wrap _pushb2phases for repo with topic stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 18 Apr 2019 13:02:52 +0200
branchstable
changeset 4543 7f1e1ba3d16b
parent 4542 f5127bfc1588
child 4544 75b414b298f5
topic: only wrap _pushb2phases for repo with topic This helps repository with and without topic to coexist in the same process.
hgext3rd/topic/discovery.py
--- a/hgext3rd/topic/discovery.py	Thu Apr 18 13:02:44 2019 +0200
+++ b/hgext3rd/topic/discovery.py	Thu Apr 18 13:02:52 2019 +0200
@@ -189,10 +189,11 @@
 handlecheckheads.params = frozenset()
 
 def _pushb2phases(orig, pushop, bundler):
-    checktypes = ('check:heads', 'check:updated-heads')
-    hascheck = any(p.type in checktypes for p in bundler._parts)
-    if not hascheck and pushop.outdatedphases:
-        exchange._pushb2ctxcheckheads(pushop, bundler)
+    if common.hastopicext(pushop.repo):
+        checktypes = ('check:heads', 'check:updated-heads')
+        hascheck = any(p.type in checktypes for p in bundler._parts)
+        if not hascheck and pushop.outdatedphases:
+            exchange._pushb2ctxcheckheads(pushop, bundler)
     return orig(pushop, bundler)
 
 def wireprotocaps(orig, repo, proto):