##// END OF EJS Templates
store: split the wrapping of encodedstore between _wrap and datafiles...
marmoute -
r51386:816e8bc6 default
parent child Browse files
Show More
@@ -602,7 +602,7 b' class basicstore:'
602 602 def join(self, f):
603 603 return self.path + b'/' + encodedir(f)
604 604
605 def _walk(self, relpath, recurse):
605 def _walk(self, relpath, recurse, undecodable=None):
606 606 '''yields (revlog_type, unencoded, size)'''
607 607 path = self.path
608 608 if relpath:
@@ -651,7 +651,7 b' class basicstore:'
651 651 (b'meta', FILEFLAGS_MANIFESTLOG),
652 652 ]
653 653 for base_dir, rl_type in dirs:
654 files = self._walk(base_dir, True)
654 files = self._walk(base_dir, True, undecodable=undecodable)
655 655 files = (f for f in files if f[1][0] is not None)
656 656 for revlog, details in _gather_revlog(files):
657 657 for ext, (t, s) in sorted(details.items()):
@@ -755,17 +755,11 b' class encodedstore(basicstore):'
755 755 self.vfs = vfsmod.filtervfs(vfs, encodefilename)
756 756 self.opener = self.vfs
757 757
758 # note: topfiles would also need a decode phase. It is just that in
759 # practice we do not have any file outside of `data/` that needs encoding.
760 # However that might change so we should probably add a test and encoding
761 # decoding for it too. see issue6548
762
763 def datafiles(
764 self, matcher=None, undecodable=None
765 ) -> Generator[BaseStoreEntry, None, None]:
766 for entry in super(encodedstore, self).datafiles():
758 def _walk(self, relpath, recurse, undecodable=None):
759 old = super()._walk(relpath, recurse)
760 new = []
761 for f1, value in old:
767 762 try:
768 f1 = entry.unencoded_path
769 763 f2 = decodefilename(f1)
770 764 except KeyError:
771 765 if undecodable is None:
@@ -774,10 +768,16 b' class encodedstore(basicstore):'
774 768 else:
775 769 undecodable.append(f1)
776 770 continue
777 if not _matchtrackedpath(f2, matcher):
778 continue
779 entry.unencoded_path = f2
780 yield entry
771 new.append((f2, value))
772 return new
773
774 def datafiles(
775 self, matcher=None, undecodable=None
776 ) -> Generator[BaseStoreEntry, None, None]:
777 entries = super(encodedstore, self).datafiles(undecodable=undecodable)
778 for entry in entries:
779 if _matchtrackedpath(entry.unencoded_path, matcher):
780 yield entry
781 781
782 782 def join(self, f):
783 783 return self.path + b'/' + encodefilename(f)
General Comments 0
You need to be logged in to leave comments. Login now