##// END OF EJS Templates
store: rename `datafiles` to `data_entries`...
marmoute -
r51397:862e3a13 default
parent child Browse files
Show More
@@ -552,7 +552,7 b' def unixpath(path):'
552 def islfilesrepo(repo):
552 def islfilesrepo(repo):
553 '''Return true if the repo is a largefile repo.'''
553 '''Return true if the repo is a largefile repo.'''
554 if b'largefiles' in repo.requirements:
554 if b'largefiles' in repo.requirements:
555 for entry in repo.store.datafiles():
555 for entry in repo.store.data_entries():
556 if entry.is_revlog and shortnameslash in entry.target_id:
556 if entry.is_revlog and shortnameslash in entry.target_id:
557 return True
557 return True
558
558
@@ -460,7 +460,7 b' def reposetup(ui, repo):'
460 if b'largefiles' in repo.requirements:
460 if b'largefiles' in repo.requirements:
461 return
461 return
462 marker = lfutil.shortnameslash
462 marker = lfutil.shortnameslash
463 for entry in repo.store.datafiles():
463 for entry in repo.store.data_entries():
464 # XXX note that this match is not rooted and can wrongly match
464 # XXX note that this match is not rooted and can wrongly match
465 # directory ending with ".hglf"
465 # directory ending with ".hglf"
466 if entry.is_revlog and marker in entry.target_id:
466 if entry.is_revlog and marker in entry.target_id:
@@ -288,7 +288,7 b' def _narrow('
288 repair.strip(ui, unfi, tostrip, topic=b'narrow', backup=backup)
288 repair.strip(ui, unfi, tostrip, topic=b'narrow', backup=backup)
289
289
290 todelete = []
290 todelete = []
291 for entry in repo.store.datafiles():
291 for entry in repo.store.data_entries():
292 if not entry.is_revlog:
292 if not entry.is_revlog:
293 continue
293 continue
294 if entry.is_filelog:
294 if entry.is_filelog:
@@ -375,7 +375,7 b' class manifestrevlogstore:'
375 ledger.markdataentry(self, treename, node)
375 ledger.markdataentry(self, treename, node)
376 ledger.markhistoryentry(self, treename, node)
376 ledger.markhistoryentry(self, treename, node)
377
377
378 for t, path, size in self._store.datafiles():
378 for t, path, size in self._store.data_entries():
379 if path[:5] != b'meta/' or path[-2:] != b'.i':
379 if path[:5] != b'meta/' or path[-2:] != b'.i':
380 continue
380 continue
381
381
@@ -172,7 +172,7 b' def onetimesetup(ui):'
172 visit.append(fp)
172 visit.append(fp)
173
173
174 if scmutil.istreemanifest(repo):
174 if scmutil.istreemanifest(repo):
175 for entry in repo.store.datafiles():
175 for entry in repo.store.data_entries():
176 if not entry.is_revlog:
176 if not entry.is_revlog:
177 continue
177 continue
178 if entry.is_manifestlog:
178 if entry.is_manifestlog:
@@ -181,7 +181,7 b' def onetimesetup(ui):'
181 # Return .d and .i files that do not match the shallow pattern
181 # Return .d and .i files that do not match the shallow pattern
182 match = state.match
182 match = state.match
183 if match and not match.always():
183 if match and not match.always():
184 for entry in repo.store.datafiles():
184 for entry in repo.store.data_entries():
185 if not entry.is_revlog:
185 if not entry.is_revlog:
186 continue
186 continue
187 if not state.match(entry.target_id):
187 if not state.match(entry.target_id):
@@ -445,7 +445,7 b' def manifestrevlogs(repo):'
445 if scmutil.istreemanifest(repo):
445 if scmutil.istreemanifest(repo):
446 # This logic is safe if treemanifest isn't enabled, but also
446 # This logic is safe if treemanifest isn't enabled, but also
447 # pointless, so we skip it if treemanifest isn't enabled.
447 # pointless, so we skip it if treemanifest isn't enabled.
448 for entry in repo.store.datafiles():
448 for entry in repo.store.data_entries():
449 if not entry.is_revlog:
449 if not entry.is_revlog:
450 continue
450 continue
451 if entry.revlog_type == store.FILEFLAGS_MANIFESTLOG:
451 if entry.revlog_type == store.FILEFLAGS_MANIFESTLOG:
@@ -824,7 +824,7 b' def repair_issue6528('
824 with context():
824 with context():
825 files = list(
825 files = list(
826 entry
826 entry
827 for entry in repo.store.datafiles()
827 for entry in repo.store.data_entries()
828 if entry.is_revlog and entry.is_filelog
828 if entry.is_revlog and entry.is_filelog
829 )
829 )
830
830
@@ -654,7 +654,7 b' class basicstore:'
654 rootstore = manifest.manifestrevlog(repo.nodeconstants, self.vfs)
654 rootstore = manifest.manifestrevlog(repo.nodeconstants, self.vfs)
655 return manifest.manifestlog(self.vfs, repo, rootstore, storenarrowmatch)
655 return manifest.manifestlog(self.vfs, repo, rootstore, storenarrowmatch)
656
656
657 def datafiles(
657 def data_entries(
658 self, matcher=None, undecodable=None
658 self, matcher=None, undecodable=None
659 ) -> Generator[BaseStoreEntry, None, None]:
659 ) -> Generator[BaseStoreEntry, None, None]:
660 """Like walk, but excluding the changelog and root manifest.
660 """Like walk, but excluding the changelog and root manifest.
@@ -735,7 +735,7 b' class basicstore:'
735 are passed with matches the matcher
735 are passed with matches the matcher
736 """
736 """
737 # yield data files first
737 # yield data files first
738 for x in self.datafiles(matcher):
738 for x in self.data_entries(matcher):
739 yield x
739 yield x
740 for x in self.topfiles():
740 for x in self.topfiles():
741 yield x
741 yield x
@@ -790,10 +790,12 b' class encodedstore(basicstore):'
790 new.append((f2, value))
790 new.append((f2, value))
791 return new
791 return new
792
792
793 def datafiles(
793 def data_entries(
794 self, matcher=None, undecodable=None
794 self, matcher=None, undecodable=None
795 ) -> Generator[BaseStoreEntry, None, None]:
795 ) -> Generator[BaseStoreEntry, None, None]:
796 entries = super(encodedstore, self).datafiles(undecodable=undecodable)
796 entries = super(encodedstore, self).data_entries(
797 undecodable=undecodable
798 )
797 for entry in entries:
799 for entry in entries:
798 if _match_tracked_entry(entry, matcher):
800 if _match_tracked_entry(entry, matcher):
799 yield entry
801 yield entry
@@ -992,7 +994,7 b' class fncachestore(basicstore):'
992 def getsize(self, path):
994 def getsize(self, path):
993 return self.rawvfs.stat(path).st_size
995 return self.rawvfs.stat(path).st_size
994
996
995 def datafiles(
997 def data_entries(
996 self, matcher=None, undecodable=None
998 self, matcher=None, undecodable=None
997 ) -> Generator[BaseStoreEntry, None, None]:
999 ) -> Generator[BaseStoreEntry, None, None]:
998 files = ((f, revlog_type(f)) for f in self.fncache)
1000 files = ((f, revlog_type(f)) for f in self.fncache)
@@ -407,7 +407,7 b' class verifier:'
407 subdirs = set()
407 subdirs = set()
408 revlogv1 = self.revlogv1
408 revlogv1 = self.revlogv1
409 undecodable = []
409 undecodable = []
410 for entry in repo.store.datafiles(undecodable=undecodable):
410 for entry in repo.store.data_entries(undecodable=undecodable):
411 for file_ in entry.files():
411 for file_ in entry.files():
412 f = file_.unencoded_path
412 f = file_.unencoded_path
413 size = file_.file_size(repo.store.vfs)
413 size = file_.file_size(repo.store.vfs)
@@ -475,7 +475,7 b' class verifier:'
475
475
476 storefiles = set()
476 storefiles = set()
477 undecodable = []
477 undecodable = []
478 for entry in repo.store.datafiles(undecodable=undecodable):
478 for entry in repo.store.data_entries(undecodable=undecodable):
479 for file_ in entry.files():
479 for file_ in entry.files():
480 size = file_.file_size(repo.store.vfs)
480 size = file_.file_size(repo.store.vfs)
481 f = file_.unencoded_path
481 f = file_.unencoded_path
@@ -664,8 +664,8 b' def issimplestorefile(f, kind, st):'
664
664
665
665
666 class simplestore(store.encodedstore):
666 class simplestore(store.encodedstore):
667 def datafiles(self, undecodable=None):
667 def data_entries(self, undecodable=None):
668 for x in super(simplestore, self).datafiles():
668 for x in super(simplestore, self).data_entries():
669 yield x
669 yield x
670
670
671 # Supplement with non-revlog files.
671 # Supplement with non-revlog files.
General Comments 0
You need to be logged in to leave comments. Login now