minitopic: handle wireproto module change from b4d85bc122bd
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 19 Apr 2018 10:53:59 +0200
changeset 3679 b12c5d107187
parent 3678 d725fe3e3989
child 3680 e2a91d4d207d
minitopic: handle wireproto module change from b4d85bc122bd This module have been scattered in other place, so we need to detect and handle this for 4.6+
hgext3rd/serverminitopic.py
--- a/hgext3rd/serverminitopic.py	Thu Apr 19 10:50:24 2018 +0200
+++ b/hgext3rd/serverminitopic.py	Thu Apr 19 10:53:59 2018 +0200
@@ -18,9 +18,14 @@
     node,
     registrar,
     util,
-    wireproto,
 )
 
+try:
+    from mercurial import wireproto
+    wireproto.branchmap
+except ImportError: # <= hg-4.5
+    from mercurial import wireprotov1server as wireproto
+
 if util.safehasattr(registrar, 'configitem'):
 
     configtable = {}