# HG changeset patch # User Matt Harbison # Date 2023-01-06 00:47:35 # Node ID b1147450c55ca9aaeaa493d1e10a976fe05b1d87 # Parent ffeeaeb2d142586228c281926a620373efabf70c sparse: fix a py2 based usage of `map()` In a local pytype run, this fixes: File "/mnt/c/Users/Matt/hg/hgext/sparse.py", line 386, in debugsparse: unsupported operand type(s) for item retrieval: 'fcounts: Iterator[int]' and '0: int' [unsupported-operands] No attribute '__getitem__' on 'fcounts: Iterator[int]' File "/mnt/c/Users/Matt/hg/hgext/sparse.py", line 387, in debugsparse: unsupported operand type(s) for item retrieval: 'fcounts: Iterator[int]' and '1: int' [unsupported-operands] No attribute '__getitem__' on 'fcounts: Iterator[int]' File "/mnt/c/Users/Matt/hg/hgext/sparse.py", line 388, in debugsparse: unsupported operand type(s) for item retrieval: 'fcounts: Iterator[int]' and '2: int' [unsupported-operands] No attribute '__getitem__' on 'fcounts: Iterator[int]' diff --git a/hgext/sparse.py b/hgext/sparse.py --- a/hgext/sparse.py +++ b/hgext/sparse.py @@ -374,7 +374,7 @@ def debugsparse(ui, repo, **opts): if refresh: try: wlock = repo.wlock() - fcounts = map( + fcounts = pycompat.maplist( len, sparse.refreshwdir( repo, repo.status(), sparse.matcher(repo), force=force