comparison hgext3rd/topic/__init__.py @ 5230:8431bb224862

branching: merge with stable
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 07 Apr 2020 19:33:40 +0200
parents 034d6d0efa7d af9f40236037
children 5cfec61b872b
comparison
equal deleted inserted replaced
5218:bf37ba1c80ee 5230:8431bb224862
138 changelog, 138 changelog,
139 cmdutil, 139 cmdutil,
140 commands, 140 commands,
141 context, 141 context,
142 error, 142 error,
143 exchange,
143 extensions, 144 extensions,
144 hg, 145 hg,
145 localrepo, 146 localrepo,
146 lock as lockmod, 147 lock as lockmod,
147 merge, 148 merge,
370 371
371 # Wrap workingctx extra to return the topic name 372 # Wrap workingctx extra to return the topic name
372 extensions.wrapfunction(context.workingctx, '__init__', wrapinit) 373 extensions.wrapfunction(context.workingctx, '__init__', wrapinit)
373 # Wrap changelog.add to drop empty topic 374 # Wrap changelog.add to drop empty topic
374 extensions.wrapfunction(changelog.changelog, 'add', wrapadd) 375 extensions.wrapfunction(changelog.changelog, 'add', wrapadd)
376 # Make exchange._checkpublish handle experimental.topic.publish-bare-branch
377 extensions.wrapfunction(exchange, '_checkpublish', flow.replacecheckpublish)
375 378
376 server.setupserver(ui) 379 server.setupserver(ui)
377 380
378 def reposetup(ui, repo): 381 def reposetup(ui, repo):
379 if not isinstance(repo, localrepo.localrepository): 382 if not isinstance(repo, localrepo.localrepository):
391 hastopicext = True 394 hastopicext = True
392 395
393 def _restrictcapabilities(self, caps): 396 def _restrictcapabilities(self, caps):
394 caps = super(topicrepo, self)._restrictcapabilities(caps) 397 caps = super(topicrepo, self)._restrictcapabilities(caps)
395 caps.add(b'topics') 398 caps.add(b'topics')
399 if self.ui.configbool(b'experimental',
400 b'topic.publish-bare-branch'):
401 caps.add(b'ext-topics-publish=auto')
396 return caps 402 return caps
397 403
398 def commit(self, *args, **kwargs): 404 def commit(self, *args, **kwargs):
399 configoverride = util.nullcontextmanager() 405 configoverride = util.nullcontextmanager()
400 if self.currenttopic != self[b'.'].topic(): 406 if self.currenttopic != self[b'.'].topic():