diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py --- a/hgext/largefiles/lfutil.py +++ b/hgext/largefiles/lfutil.py @@ -552,7 +552,7 @@ def unixpath(path): def islfilesrepo(repo): '''Return true if the repo is a largefile repo.''' if b'largefiles' in repo.requirements: - for entry in repo.store.datafiles(): + for entry in repo.store.data_entries(): if entry.is_revlog and shortnameslash in entry.target_id: return True diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py --- a/hgext/largefiles/reposetup.py +++ b/hgext/largefiles/reposetup.py @@ -460,7 +460,7 @@ def reposetup(ui, repo): if b'largefiles' in repo.requirements: return marker = lfutil.shortnameslash - for entry in repo.store.datafiles(): + for entry in repo.store.data_entries(): # XXX note that this match is not rooted and can wrongly match # directory ending with ".hglf" if entry.is_revlog and marker in entry.target_id: diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py --- a/hgext/narrow/narrowcommands.py +++ b/hgext/narrow/narrowcommands.py @@ -288,7 +288,7 @@ def _narrow( repair.strip(ui, unfi, tostrip, topic=b'narrow', backup=backup) todelete = [] - for entry in repo.store.datafiles(): + for entry in repo.store.data_entries(): if not entry.is_revlog: continue if entry.is_filelog: diff --git a/hgext/remotefilelog/contentstore.py b/hgext/remotefilelog/contentstore.py --- a/hgext/remotefilelog/contentstore.py +++ b/hgext/remotefilelog/contentstore.py @@ -375,7 +375,7 @@ class manifestrevlogstore: ledger.markdataentry(self, treename, node) ledger.markhistoryentry(self, treename, node) - for t, path, size in self._store.datafiles(): + for t, path, size in self._store.data_entries(): if path[:5] != b'meta/' or path[-2:] != b'.i': continue diff --git a/hgext/remotefilelog/remotefilelogserver.py b/hgext/remotefilelog/remotefilelogserver.py --- a/hgext/remotefilelog/remotefilelogserver.py +++ b/hgext/remotefilelog/remotefilelogserver.py @@ -172,7 +172,7 @@ def onetimesetup(ui): visit.append(fp) if scmutil.istreemanifest(repo): - for entry in repo.store.datafiles(): + for entry in repo.store.data_entries(): if not entry.is_revlog: continue if entry.is_manifestlog: @@ -181,7 +181,7 @@ def onetimesetup(ui): # Return .d and .i files that do not match the shallow pattern match = state.match if match and not match.always(): - for entry in repo.store.datafiles(): + for entry in repo.store.data_entries(): if not entry.is_revlog: continue if not state.match(entry.target_id): diff --git a/mercurial/repair.py b/mercurial/repair.py --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -445,7 +445,7 @@ def manifestrevlogs(repo): if scmutil.istreemanifest(repo): # This logic is safe if treemanifest isn't enabled, but also # pointless, so we skip it if treemanifest isn't enabled. - for entry in repo.store.datafiles(): + for entry in repo.store.data_entries(): if not entry.is_revlog: continue if entry.revlog_type == store.FILEFLAGS_MANIFESTLOG: diff --git a/mercurial/revlogutils/rewrite.py b/mercurial/revlogutils/rewrite.py --- a/mercurial/revlogutils/rewrite.py +++ b/mercurial/revlogutils/rewrite.py @@ -824,7 +824,7 @@ def repair_issue6528( with context(): files = list( entry - for entry in repo.store.datafiles() + for entry in repo.store.data_entries() if entry.is_revlog and entry.is_filelog ) diff --git a/mercurial/store.py b/mercurial/store.py --- a/mercurial/store.py +++ b/mercurial/store.py @@ -654,7 +654,7 @@ class basicstore: rootstore = manifest.manifestrevlog(repo.nodeconstants, self.vfs) return manifest.manifestlog(self.vfs, repo, rootstore, storenarrowmatch) - def datafiles( + def data_entries( self, matcher=None, undecodable=None ) -> Generator[BaseStoreEntry, None, None]: """Like walk, but excluding the changelog and root manifest. @@ -735,7 +735,7 @@ class basicstore: are passed with matches the matcher """ # yield data files first - for x in self.datafiles(matcher): + for x in self.data_entries(matcher): yield x for x in self.topfiles(): yield x @@ -790,10 +790,12 @@ class encodedstore(basicstore): new.append((f2, value)) return new - def datafiles( + def data_entries( self, matcher=None, undecodable=None ) -> Generator[BaseStoreEntry, None, None]: - entries = super(encodedstore, self).datafiles(undecodable=undecodable) + entries = super(encodedstore, self).data_entries( + undecodable=undecodable + ) for entry in entries: if _match_tracked_entry(entry, matcher): yield entry @@ -992,7 +994,7 @@ class fncachestore(basicstore): def getsize(self, path): return self.rawvfs.stat(path).st_size - def datafiles( + def data_entries( self, matcher=None, undecodable=None ) -> Generator[BaseStoreEntry, None, None]: files = ((f, revlog_type(f)) for f in self.fncache) diff --git a/mercurial/verify.py b/mercurial/verify.py --- a/mercurial/verify.py +++ b/mercurial/verify.py @@ -407,7 +407,7 @@ class verifier: subdirs = set() revlogv1 = self.revlogv1 undecodable = [] - for entry in repo.store.datafiles(undecodable=undecodable): + for entry in repo.store.data_entries(undecodable=undecodable): for file_ in entry.files(): f = file_.unencoded_path size = file_.file_size(repo.store.vfs) @@ -475,7 +475,7 @@ class verifier: storefiles = set() undecodable = [] - for entry in repo.store.datafiles(undecodable=undecodable): + for entry in repo.store.data_entries(undecodable=undecodable): for file_ in entry.files(): size = file_.file_size(repo.store.vfs) f = file_.unencoded_path diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py --- a/tests/simplestorerepo.py +++ b/tests/simplestorerepo.py @@ -664,8 +664,8 @@ def issimplestorefile(f, kind, st): class simplestore(store.encodedstore): - def datafiles(self, undecodable=None): - for x in super(simplestore, self).datafiles(): + def data_entries(self, undecodable=None): + for x in super(simplestore, self).data_entries(): yield x # Supplement with non-revlog files.