# HG changeset patch # User Anton Shestakov # Date 1710624438 10800 # Node ID c81bb5135307de3abab4681d84103a063b054870 # Parent 79c50e9635e14d4af8b389ca286c84121720c412 topic: make sure filtername is not None This is similar to 4188a0570ba1 in core. diff -r 79c50e9635e1 -r c81bb5135307 hgext3rd/topic/topicmap.py --- a/hgext3rd/topic/topicmap.py Wed Jun 12 19:27:31 2024 +0400 +++ b/hgext3rd/topic/topicmap.py Sat Mar 16 18:27:18 2024 -0300 @@ -40,17 +40,16 @@ if not common.hastopicext(repo): return repo filtername = topicfilter(repo.filtername) - if filtername == repo.filtername: + if filtername is None or filtername == repo.filtername: return repo return repo.filtered(filtername) def _setuptopicfilter(ui): """extend the filter related mapping with topic related one""" - # filter level not affected by topic that we should not override - for plainname in list(repoview.filtertable): newfilter = topicfilter(plainname) if newfilter == plainname: + # filter level not affected by topic that we should not override continue def revsfunc(repo, name=plainname): @@ -92,7 +91,11 @@ def cgapply(orig, self, repo, *args, **kwargs): """make sure a topicmap is used when applying a changegroup""" - other = repo.filtered(topicfilter(repo.filtername)) + newfilter = topicfilter(repo.filtername) + if newfilter is None: + other = repo + else: + other = repo.filtered(newfilter) return orig(self, other, *args, **kwargs) def commitstatus(orig, repo, node, branch, bheads=None, tip=None, **opts):