diff hgext3rd/topic/discovery.py @ 4540:22cde12d9467 stable

topic: only wrap _headssummary for repo with topic This helps repository with and without topic to coexist in the same process.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 18 Apr 2019 13:01:39 +0200
parents 35130e428ebd
children 7e98faf278d6
line wrap: on
line diff
--- 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)