changeset 6782:c81bb5135307

topic: make sure filtername is not None This is similar to 4188a0570ba1 in core.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 16 Mar 2024 18:27:18 -0300
parents 79c50e9635e1
children ccc8352c7133
files hgext3rd/topic/topicmap.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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):