372 # Wrap workingctx extra to return the topic name |
372 # Wrap workingctx extra to return the topic name |
373 extensions.wrapfunction(context.workingctx, '__init__', wrapinit) |
373 extensions.wrapfunction(context.workingctx, '__init__', wrapinit) |
374 # Wrap changelog.add to drop empty topic |
374 # Wrap changelog.add to drop empty topic |
375 extensions.wrapfunction(changelog.changelog, 'add', wrapadd) |
375 extensions.wrapfunction(changelog.changelog, 'add', wrapadd) |
376 # Make exchange._checkpublish handle experimental.topic.publish-bare-branch |
376 # Make exchange._checkpublish handle experimental.topic.publish-bare-branch |
377 extensions.wrapfunction(exchange, '_checkpublish', flow.replacecheckpublish) |
377 if util.safehasattr(exchange, '_checkpublish'): |
|
378 extensions.wrapfunction(exchange, '_checkpublish', |
|
379 flow.replacecheckpublish) |
|
380 else: |
|
381 # hg <= 4.8 (33d30fb1e4ae) |
|
382 try: |
|
383 evolve = extensions.find(b'evolve') |
|
384 extensions.wrapfunction(evolve.safeguard, '_checkpublish', |
|
385 flow.replacecheckpublish) |
|
386 except (KeyError, AttributeError): |
|
387 pass |
378 |
388 |
379 server.setupserver(ui) |
389 server.setupserver(ui) |
380 |
390 |
381 def reposetup(ui, repo): |
391 def reposetup(ui, repo): |
382 if not isinstance(repo, localrepo.localrepository): |
392 if not isinstance(repo, localrepo.localrepository): |