##// END OF EJS Templates
store: do the revlog matching on entry directly...
marmoute -
r51387:b4953fad default
parent child Browse files
Show More
@@ -33,7 +33,7 b" parsers = policy.importmod('parsers')"
33 fncache_chunksize = 10 ** 6
33 fncache_chunksize = 10 ** 6
34
34
35
35
36 def _matchtrackedpath(path, matcher):
36 def _match_tracked_entry(entry, matcher):
37 """parses a fncache entry and returns whether the entry is tracking a path
37 """parses a fncache entry and returns whether the entry is tracking a path
38 matched by matcher or not.
38 matched by matcher or not.
39
39
@@ -41,13 +41,11 b' def _matchtrackedpath(path, matcher):'
41
41
42 if matcher is None:
42 if matcher is None:
43 return True
43 return True
44 path = decodedir(path)
44 if entry.revlog_type == FILEFLAGS_FILELOG:
45 if path.startswith(b'data/'):
45 return matcher(entry.target_id)
46 return matcher(path[len(b'data/') : -len(b'.i')])
46 elif entry.revlog_type == FILEFLAGS_MANIFESTLOG:
47 elif path.startswith(b'meta/'):
47 return matcher.visitdir(entry.target_id.rstrip(b'/'))
48 return matcher.visitdir(path[len(b'meta/') : -len(b'/00manifest.i')])
48 raise error.ProgrammingError(b"cannot process entry %r" % entry)
49
50 raise error.ProgrammingError(b"cannot decode path %s" % path)
51
49
52
50
53 # This avoids a collision between a file named foo and a dir named
51 # This avoids a collision between a file named foo and a dir named
@@ -776,7 +774,7 b' class encodedstore(basicstore):'
776 ) -> Generator[BaseStoreEntry, None, None]:
774 ) -> Generator[BaseStoreEntry, None, None]:
777 entries = super(encodedstore, self).datafiles(undecodable=undecodable)
775 entries = super(encodedstore, self).datafiles(undecodable=undecodable)
778 for entry in entries:
776 for entry in entries:
779 if _matchtrackedpath(entry.unencoded_path, matcher):
777 if _match_tracked_entry(entry, matcher):
780 yield entry
778 yield entry
781
779
782 def join(self, f):
780 def join(self, f):
@@ -996,15 +994,15 b' class fncachestore(basicstore):'
996 assert False, revlog
994 assert False, revlog
997 for ext, t in sorted(details.items()):
995 for ext, t in sorted(details.items()):
998 f = revlog + ext
996 f = revlog + ext
999 if not _matchtrackedpath(f, matcher):
997 entry = RevlogStoreEntry(
1000 continue
1001 yield RevlogStoreEntry(
1002 unencoded_path=f,
998 unencoded_path=f,
1003 revlog_type=rl_type,
999 revlog_type=rl_type,
1004 target_id=revlog_target_id,
1000 target_id=revlog_target_id,
1005 is_revlog_main=bool(t & FILEFLAGS_REVLOG_MAIN),
1001 is_revlog_main=bool(t & FILEFLAGS_REVLOG_MAIN),
1006 is_volatile=bool(t & FILEFLAGS_VOLATILE),
1002 is_volatile=bool(t & FILEFLAGS_VOLATILE),
1007 )
1003 )
1004 if _match_tracked_entry(entry, matcher):
1005 yield entry
1008
1006
1009 def copylist(self):
1007 def copylist(self):
1010 d = (
1008 d = (
General Comments 0
You need to be logged in to leave comments. Login now