diff hgext3rd/topic/server.py @ 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 c705c4069fb1
children e0c091b199bc
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,