diff hgext3rd/topic/server.py @ 5931:6357551cb66f stable

topic: announce ext-topics-publish capability in case of SSH and HTTP too
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 24 May 2021 14:26:42 +0800
parents a4d081923c81
children a87abe69a2f8
line wrap: on
line diff
--- a/hgext3rd/topic/server.py	Wed May 19 16:28:47 2021 +0800
+++ b/hgext3rd/topic/server.py	Mon May 24 14:26:42 2021 +0800
@@ -71,6 +71,13 @@
     caps = orig(repo, proto)
     if common.hastopicext(repo) and repo.peer().capable(b'topics'):
         caps.append(b'_exttopics_heads')
+        if repo.ui.configbool(b'phases', b'publish'):
+            mode = b'all'
+        elif repo.ui.configbool(b'experimental', b'topic.publish-bare-branch'):
+            mode = b'auto'
+        else:
+            mode = b'none'
+        caps.append(b'ext-topics-publish=%s' % mode)
     return caps
 
 def setupserver(ui):