topic: only wrap _headssummary for repo with topic stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 18 Apr 2019 13:01:39 +0200
branchstable
changeset 4540 22cde12d9467
parent 4539 91628e5c0f6d
child 4541 7e98faf278d6
topic: only wrap _headssummary 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 12:41:41 2019 +0200
+++ b/hgext3rd/topic/discovery.py	Thu Apr 18 13:01:39 2019 +0200
@@ -12,6 +12,9 @@
     extensions,
     util,
 )
+from . import (
+    common,
+)
 
 try:
     from mercurial import wireproto
@@ -26,7 +29,10 @@
 
     publishing = ('phases' not in remote.listkeys('namespaces')
                   or bool(remote.listkeys('phases').get('publishing', False)))
-    if ((publishing or not remote.capable('topics'))
+
+    if not common.hastopicext(pushop.repo):
+        return orig(pushop, *args, **kwargs)
+    elif ((publishing or not remote.capable('topics'))
             and not getattr(pushop, 'publish', False)):
         return orig(pushop, *args, **kwargs)