hgext3rd/serverminitopic.py
branchmercurial-4.9
changeset 5365 f7b4b6698e91
parent 5193 a4d081923c81
--- a/hgext3rd/serverminitopic.py	Wed Apr 08 01:16:56 2020 +0800
+++ b/hgext3rd/serverminitopic.py	Fri May 08 20:36:31 2020 +0800
@@ -23,12 +23,7 @@
     util,
 )
 
-# hg <= 4.5 (b4d85bc122bd)
-try:
-    from mercurial import wireproto  # pytype: disable=import-error
-    wireproto.branchmap
-except ImportError:
-    from mercurial import wireprotov1server as wireproto
+from mercurial import wireprotov1server
 
 if util.safehasattr(registrar, 'configitem'):
 
@@ -163,7 +158,7 @@
         if util.safehasattr(self, '_entries'):
             _entries = self._entries
         else:
-            # hg <= 4.9 (624d6683c705, b137a6793c51)
+            # hg <= 4.9 (624d6683c705+b137a6793c51)
             _entries = self
         new = self.__class__(_entries, self.tipnode, self.tiprev,
                              self.filteredhash, self._closednodes)
@@ -237,11 +232,11 @@
 def uisetup(ui):
     wrapclass(branchmap, 'branchcache', _topiccache)
     try:
-        # Mercurial 4.8 and older
+        # hg <= 4.9 (3461814417f3)
         extensions.wrapfunction(branchmap, 'read', wrapread)
     except AttributeError:
-        # Mercurial 4.9; branchcache.fromfile now takes care of this
+        # Mercurial 5.0; branchcache.fromfile now takes care of this
         # which is alredy defined on _topiccache
         pass
-    extensions.wrapfunction(wireproto, '_capabilities', wireprotocaps)
+    extensions.wrapfunction(wireprotov1server, '_capabilities', wireprotocaps)
     extensions.wrapfunction(context.changectx, 'branch', topicbranch)