compat: fix subsettable import for mercurial <= 4.8 stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 04 Mar 2020 16:36:32 +0100
branchstable
changeset 5148 366f6e4108d6
parent 5147 83b607a9296d
child 5149 3f40b39d091e
compat: fix subsettable import for mercurial <= 4.8
hgext3rd/topic/server.py
--- a/hgext3rd/topic/server.py	Wed Mar 04 16:05:28 2020 +0100
+++ b/hgext3rd/topic/server.py	Wed Mar 04 16:36:32 2020 +0100
@@ -10,9 +10,15 @@
     wireprotov1server,
 )
 
-from mercurial.utils import (
-    repoviewutil,
-)
+
+try:
+    from mercurial.utils import (
+        repoviewutil,
+    )
+    repoviewutil.subsettable
+except (AttributeError, ImportError):
+    # hg <= 4.8
+    from mercurial import branchmap as repoviewutil
 
 from . import (
     common,