Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/logcmdutil.py @ 46389:8f8fce2dd594 stable
typing: switch an argument type to the generic form
This fixes the following pytype complaint:
File "/mnt/c/Users/Matt/hg/mercurial/commands.py", line 4672, in log: Function mercurial.logcmdutil.parseopts was called with the wrong arguments [wrong-arg-types]
Expected: (ui, pats: List[Union[bytearray, bytes, memoryview]], ...)
Actually passed: (ui, pats: tuple, ...)
Differential Revision: https://phab.mercurial-scm.org/D10167
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 11 Mar 2021 17:02:28 -0500 |
parents | 9842c00f0252 |
children | e2f7b2695ba1 |
comparison
equal
deleted
inserted
replaced
46388:ae62ab82a345 | 46389:8f8fce2dd594 |
---|---|
49 Any, | 49 Any, |
50 Callable, | 50 Callable, |
51 Dict, | 51 Dict, |
52 List, | 52 List, |
53 Optional, | 53 Optional, |
54 Sequence, | |
54 Tuple, | 55 Tuple, |
55 ) | 56 ) |
56 | 57 |
57 for t in (Any, Callable, Dict, List, Optional, Tuple): | 58 for t in (Any, Callable, Dict, List, Optional, Tuple): |
58 assert t | 59 assert t |
721 # limit number of changes displayed; None means unlimited | 722 # limit number of changes displayed; None means unlimited |
722 limit = attr.ib(default=None) # type: Optional[int] | 723 limit = attr.ib(default=None) # type: Optional[int] |
723 | 724 |
724 | 725 |
725 def parseopts(ui, pats, opts): | 726 def parseopts(ui, pats, opts): |
726 # type: (Any, List[bytes], Dict[bytes, Any]) -> walkopts | 727 # type: (Any, Sequence[bytes], Dict[bytes, Any]) -> walkopts |
727 """Parse log command options into walkopts | 728 """Parse log command options into walkopts |
728 | 729 |
729 The returned walkopts will be passed in to getrevs() or makewalker(). | 730 The returned walkopts will be passed in to getrevs() or makewalker(). |
730 """ | 731 """ |
731 if opts.get(b'follow_first'): | 732 if opts.get(b'follow_first'): |