# HG changeset patch # User Anton Shestakov # Date 1705178077 10800 # Node ID 61a356e2392195afb2007e5eff4255c65deb1117 # Parent 094fa826f60b5a2da63cb6227be80a2679872024 topic: drop repoviewutil.subsettable compatibility for hg 4.9 diff -r 094fa826f60b -r 61a356e23921 hgext3rd/topic/topicmap.py --- 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"""