typing: disable some pytype errors in `mercurial.store`
These seem to be legitimate errors, since one of the two callers
(`encodedstore.data_entries()`) was previously typed to generate
`BaseStoreEntry`. However, that and the other caller only pass
`RevlogStoreEntry` objects. I can't tell if this was a WIP or what, but don't
want to get side tracked on this. So flag as a TODO for later.
--- a/mercurial/store.py Tue Jul 23 19:05:26 2024 -0400
+++ b/mercurial/store.py Tue Jul 23 19:14:16 2024 -0400
@@ -40,7 +40,7 @@
fncache_chunksize = 10**6
-def _match_tracked_entry(entry, matcher):
+def _match_tracked_entry(entry: "BaseStoreEntry", matcher):
"""parses a fncache entry and returns whether the entry is tracking a path
matched by matcher or not.
@@ -48,10 +48,16 @@
if matcher is None:
return True
+
+ # TODO: make this safe for other entry types. Currently, the various
+ # store.data_entry generators only yield RevlogStoreEntry, so the
+ # attributes do exist on `entry`.
+ # pytype: disable=attribute-error
if entry.is_filelog:
return matcher(entry.target_id)
elif entry.is_manifestlog:
return matcher.visitdir(entry.target_id.rstrip(b'/'))
+ # pytype: enable=attribute-error
raise error.ProgrammingError(b"cannot process entry %r" % entry)