# HG changeset patch # User Matt Harbison # Date 2024-10-23 19:13:40 # Node ID ef119f914fc13c3e2a11de0ee9f7dd7f259b15c0 # Parent ba8f03ad89065530d82ec086a12a1f940ad0d0a4 localrepo: subclass the new `ilocalrepositoryfilestorage` Protocol class This is the same transformation as 3a90a6fd710d did for dirstate, but the CamelCase naming was already cleaned up here. See 4ef6dbc27a99 for the benefits of explicit subclassing. Since there's only one method in this Protocol class and it needs to be abstract because of the direct subclassing (see cdd4bc69bfc1), do that here. diff --git a/hgext/sqlitestore.py b/hgext/sqlitestore.py --- a/hgext/sqlitestore.py +++ b/hgext/sqlitestore.py @@ -86,7 +86,6 @@ from mercurial import ( ) from mercurial.interfaces import ( repository, - util as interfaceutil, ) from mercurial.utils import ( hashutil, @@ -1282,8 +1281,7 @@ def newreporequirements(orig, ui, create return requirements -@interfaceutil.implementer(repository.ilocalrepositoryfilestorage) -class sqlitefilestorage: +class sqlitefilestorage(repository.ilocalrepositoryfilestorage): """Repository file storage backed by SQLite.""" def file(self, path): diff --git a/mercurial/interfaces/repository.py b/mercurial/interfaces/repository.py --- a/mercurial/interfaces/repository.py +++ b/mercurial/interfaces/repository.py @@ -1658,6 +1658,7 @@ class ilocalrepositoryfilestorage(Protoc tracked file path. """ + @abc.abstractmethod def file(self, f): """Obtain a filelog for a tracked path. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1241,7 +1241,7 @@ def makemain(**kwargs): return localrepository -class revlogfilestorage: # (repository.ilocalrepositoryfilestorage) +class revlogfilestorage(repository.ilocalrepositoryfilestorage): """File storage when using revlogs.""" def file(self, path): @@ -1256,7 +1256,7 @@ class revlogfilestorage: # (repository. return filelog.filelog(self.svfs, path, try_split=try_split) -class revlognarrowfilestorage: # (repository.ilocalrepositoryfilestorage) +class revlognarrowfilestorage(repository.ilocalrepositoryfilestorage): """File storage when using revlogs and narrow files.""" def file(self, path):