hgext3rd/topic/__init__.py
branchstable
changeset 5266 af9f40236037
parent 5154 3ff25aafdb4e
child 5275 1a81bbc94d45
child 5276 8431bb224862
--- a/hgext3rd/topic/__init__.py	Sat Mar 21 15:04:18 2020 +0100
+++ b/hgext3rd/topic/__init__.py	Mon Apr 06 05:05:07 2020 +0200
@@ -140,6 +140,7 @@
     commands,
     context,
     error,
+    exchange,
     extensions,
     hg,
     localrepo,
@@ -380,6 +381,8 @@
     extensions.wrapfunction(context.workingctx, '__init__', wrapinit)
     # Wrap changelog.add to drop empty topic
     extensions.wrapfunction(changelog.changelog, 'add', wrapadd)
+    # Make exchange._checkpublish handle experimental.topic.publish-bare-branch
+    extensions.wrapfunction(exchange, '_checkpublish', flow.replacecheckpublish)
 
     server.setupserver(ui)
 
@@ -401,6 +404,9 @@
         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')
             return caps
 
         def commit(self, *args, **kwargs):