changeset 6747:61a356e23921

topic: drop repoviewutil.subsettable compatibility for hg 4.9
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 13 Jan 2024 17:34:37 -0300
parents 094fa826f60b
children c6ff8ae8a752
files hgext3rd/topic/topicmap.py
diffstat 1 files changed, 9 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/topicmap.py	Thu Jan 11 15:26:49 2024 -0300
+++ b/hgext3rd/topic/topicmap.py	Sat Jan 13 17:34:37 2024 -0300
@@ -12,6 +12,8 @@
     util,
 )
 
+from mercurial.utils import repoviewutil
+
 from . import (
     common,
     compat,
@@ -45,13 +47,9 @@
 
 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
 
-    for plainname in list(funcmap):
+    for plainname in list(repoview.filtertable):
         newfilter = topicfilter(plainname)
         if newfilter == plainname:
             continue
@@ -59,13 +57,13 @@
         def revsfunc(repo, name=plainname):
             return repoview.filterrevs(repo, name)
 
-        base = topicfilter(partialmap[plainname])
+        base = topicfilter(repoviewutil.subsettable[plainname])
 
-        if newfilter not in funcmap:
-            funcmap[newfilter] = revsfunc
-            partialmap[newfilter] = base
-    funcmap[b'unfiltered-topic'] = lambda repo: frozenset()
-    partialmap[b'unfiltered-topic'] = b'visible-topic'
+        if newfilter not in repoview.filtertable:
+            repoview.filtertable[newfilter] = revsfunc
+            repoviewutil.subsettable[newfilter] = base
+    repoview.filtertable[b'unfiltered-topic'] = lambda repo: frozenset()
+    repoviewutil.subsettable[b'unfiltered-topic'] = b'visible-topic'
 
 def _phaseshash(repo, maxrev):
     """uniq ID for a phase matching a set of rev"""