comparison mercurial/revlogutils/rewrite.py @ 50471:521fec115dad

store: use a StoreEntry object instead of tuple for store files We want to make the store return more semantic information instead of a stream of file path. To achieve this, we start with adding a simple object that hold the same information as the tuple it replace, and do a simple update to the user code to fetch and use the same information. From there, we will be able to iteratively upgrade the codebase toward better objects.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 15 May 2023 08:56:23 +0200
parents a52aae8bcc7a
children 85c5b4b507af
comparison
equal deleted inserted replaced
50470:814f55775b21 50471:521fec115dad
823 823
824 report_entries = [] 824 report_entries = []
825 825
826 with context(): 826 with context():
827 files = list( 827 files = list(
828 (file_type, path) 828 entry
829 for (file_type, path, _s) in repo.store.datafiles() 829 for entry in repo.store.datafiles()
830 if path.endswith(b'.i') and file_type & store.FILEFLAGS_FILELOG 830 if (
831 entry.unencoded_path.endswith(b'.i')
832 and entry.is_revlog
833 and entry.revlog_type == store.FILEFLAGS_FILELOG
834 )
831 ) 835 )
832 836
833 progress = ui.makeprogress( 837 progress = ui.makeprogress(
834 _(b"looking for affected revisions"), 838 _(b"looking for affected revisions"),
835 unit=_(b"filelogs"), 839 unit=_(b"filelogs"),
836 total=len(files), 840 total=len(files),
837 ) 841 )
838 found_nothing = True 842 found_nothing = True
839 843
840 for file_type, path in files: 844 for entry in files:
845 path = entry.unencoded_path
841 progress.increment() 846 progress.increment()
842 filename = _get_filename_from_filelog_index(path) 847 filename = _get_filename_from_filelog_index(path)
843 fl = _filelog_from_filename(repo, filename) 848 fl = _filelog_from_filename(repo, filename)
844 849
845 # Set of filerevs (or hex filenodes if `to_report`) that need fixing 850 # Set of filerevs (or hex filenodes if `to_report`) that need fixing