diff hgext3rd/topic/__init__.py @ 5231:1a81bbc94d45 stable

topic: check that exchange._checkpublish() exists before wrapping it
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 08 Apr 2020 01:02:23 +0800
parents af9f40236037
children 9ed5f9c5d8ae
line wrap: on
line diff
--- 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)