changeset 51532:d54f0692820d

repoview: prevent `None` to be passed as the filtername We let such instantiation slip in a previous commit, so we add an explicit check to prevent it to happen in the future.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 11 Mar 2024 01:20:12 +0100
parents 4188a0570ba1
children 749e7685935a
files mercurial/repoview.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/repoview.py	Thu Mar 07 11:04:34 2024 +0100
+++ b/mercurial/repoview.py	Mon Mar 11 01:20:12 2024 +0100
@@ -397,6 +397,9 @@
     """
 
     def __init__(self, repo, filtername, visibilityexceptions=None):
+        if filtername is None:
+            msg = "repoview should have a non-None filtername"
+            raise error.ProgrammingError(msg)
         object.__setattr__(self, '_unfilteredrepo', repo)
         object.__setattr__(self, 'filtername', filtername)
         object.__setattr__(self, '_clcachekey', None)