auto-publish: issue the capabilities in all cases stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 07 Apr 2020 15:39:23 +0200
branchstable
changeset 5297 2de59d916266
parent 5296 49cabb2d16f8
child 5298 a828c7a7ace1
auto-publish: issue the capabilities in all cases It seems better to message client that we support the capabilities in all cases.
hgext3rd/topic/__init__.py
--- a/hgext3rd/topic/__init__.py	Thu Apr 16 18:32:14 2020 +0800
+++ b/hgext3rd/topic/__init__.py	Tue Apr 07 15:39:23 2020 +0200
@@ -414,9 +414,14 @@
         def _restrictcapabilities(self, caps):
             caps = super(topicrepo, self)._restrictcapabilities(caps)
             caps.add(b'topics')
-            if self.ui.configbool(b'experimental',
-                                  b'topic.publish-bare-branch'):
-                caps.add(b'ext-topics-publish=auto')
+            if self.ui.configbool(b'phases', b'publish'):
+                mode = b'all'
+            elif self.ui.configbool(b'experimental',
+                                    b'topic.publish-bare-branch'):
+                mode = b'auto'
+            else:
+                mode = b'none'
+            caps.add(b'ext-topics-publish=%s' % mode)
             return caps
 
         def commit(self, *args, **kwargs):