changeset 5148:366f6e4108d6 stable

compat: fix subsettable import for mercurial <= 4.8
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 04 Mar 2020 16:36:32 +0100
parents 83b607a9296d
children 3f40b39d091e
files hgext3rd/topic/server.py
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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,