# HG changeset patch # User Anton Shestakov # Date 1586278943 -28800 # Node ID 1a81bbc94d45fd3a06c6a13c40145d64356f8445 # Parent fa1324e58fcfb4013490cdf211df51ce56e6be9d topic: check that exchange._checkpublish() exists before wrapping it diff -r fa1324e58fcf -r 1a81bbc94d45 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Thu Mar 12 02:08:39 2020 +0100 +++ b/hgext3rd/topic/__init__.py Wed Apr 08 01:02:23 2020 +0800 @@ -382,7 +382,10 @@ # 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) + if util.safehasattr(exchange, '_checkpublish'): + # hg <= 4.8 (33d30fb1e4ae) + extensions.wrapfunction(exchange, '_checkpublish', + flow.replacecheckpublish) server.setupserver(ui)