--- 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):