Mercurial > public > mercurial-scm > hg
comparison mercurial/obsutil.py @ 46791:d35063ebd761 stable
obsutil: maintain a homogenous list when computing successors
In practice, this wasn't a problem because of an internal check for an empty
list, but it avoids the following pytype error:
File "/mnt/c/Users/Matt/hg/mercurial/obsutil.py", line 823, in successorsandmarkers: No attribute 'markers' on List[nothing] [attribute-error]
In Union[Any, List[nothing], _succs]
Differential Revision: https://phab.mercurial-scm.org/D10213
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 12 Mar 2021 21:19:17 -0500 |
parents | 59fa3890d40a |
children | fff5942d445f |
comparison
equal
deleted
inserted
replaced
46790:5137896602d9 | 46791:d35063ebd761 |
---|---|
780 ssets = successorssets(repo, ctx.node(), closest=True) | 780 ssets = successorssets(repo, ctx.node(), closest=True) |
781 | 781 |
782 # closestsuccessors returns an empty list for pruned revisions, remap it | 782 # closestsuccessors returns an empty list for pruned revisions, remap it |
783 # into a list containing an empty list for future processing | 783 # into a list containing an empty list for future processing |
784 if ssets == []: | 784 if ssets == []: |
785 ssets = [[]] | 785 ssets = [_succs()] |
786 | 786 |
787 # Try to recover pruned markers | 787 # Try to recover pruned markers |
788 succsmap = repo.obsstore.successors | 788 succsmap = repo.obsstore.successors |
789 fullsuccessorsets = [] # successor set + markers | 789 fullsuccessorsets = [] # successor set + markers |
790 for sset in ssets: | 790 for sset in ssets: |