topic: only wrap _headssummary for repo with topic
This helps repository with and without topic to coexist in the same process.
--- 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)