From patchwork Sat Mar 13 19:34:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D10213: obsutil: maintain a homogenous list when computing successors From: phabricator X-Patchwork-Id: 48527 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sat, 13 Mar 2021 19:34:26 +0000 mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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] REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D10213 AFFECTED FILES mercurial/obsutil.py CHANGE DETAILS To: mharbison72, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py --- a/mercurial/obsutil.py +++ b/mercurial/obsutil.py @@ -782,7 +782,7 @@ # closestsuccessors returns an empty list for pruned revisions, remap it # into a list containing an empty list for future processing if ssets == []: - ssets = [[]] + ssets = [_succs()] # Try to recover pruned markers succsmap = repo.obsstore.successors