changeset 5251:2de59d916266 stable

auto-publish: issue the capabilities in all cases It seems better to message client that we support the capabilities in all cases.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 07 Apr 2020 15:39:23 +0200
parents 49cabb2d16f8
children a828c7a7ace1
files hgext3rd/topic/__init__.py
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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):