# HG changeset patch # User Anton Shestakov # Date 1675608458 -14400 # Node ID a87abe69a2f85bd6b5c54e9d4e0796654f0d8daf # Parent e8d85d51c7b2efad48b6a8f1e23bd1a023516854 topic: branchmap already imports subsettable from repoviewutil Even on hg <= 4.9. But let's add a comment so that we can import from repoviewutil module directly when we drop compatibility with 4.9. diff -r e8d85d51c7b2 -r a87abe69a2f8 hgext3rd/topic/server.py --- a/hgext3rd/topic/server.py Thu Dec 15 17:07:25 2022 +0400 +++ b/hgext3rd/topic/server.py Sun Feb 05 18:47:38 2023 +0400 @@ -3,6 +3,7 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from mercurial import ( + branchmap, extensions, repoview, wireprototypes, @@ -10,15 +11,6 @@ wireprotov1server, ) -try: - from mercurial.utils import ( - repoviewutil, - ) - repoviewutil.subsettable -except (AttributeError, ImportError): - # hg <= 4.9 (caebe5e7f4bd) - from mercurial import branchmap as repoviewutil - from . import ( common, constants, @@ -102,5 +94,6 @@ if FILTERNAME not in repoview.filtertable: repoview.filtertable[FILTERNAME] = computeunservedtopic - repoviewutil.subsettable[FILTERNAME] = b'immutable' - repoviewutil.subsettable[b'served'] = FILTERNAME + # hg <= 4.9 (caebe5e7f4bd) + branchmap.subsettable[FILTERNAME] = b'immutable' + branchmap.subsettable[b'served'] = FILTERNAME diff -r e8d85d51c7b2 -r a87abe69a2f8 hgext3rd/topic/topicmap.py --- a/hgext3rd/topic/topicmap.py Thu Dec 15 17:07:25 2022 +0400 +++ b/hgext3rd/topic/topicmap.py Sun Feb 05 18:47:38 2023 +0400 @@ -44,6 +44,7 @@ def _setuptopicfilter(ui): """extend the filter related mapping with topic related one""" funcmap = repoview.filtertable + # hg <= 4.9 (caebe5e7f4bd) partialmap = branchmap.subsettable # filter level not affected by topic that we should not override