Patchwork D10213: obsutil: maintain a homogenous list when computing successors

login
register
mail settings
Submitter phabricator
Date March 13, 2021, 7:34 p.m.
Message ID <differential-rev-PHID-DREV-eg3edavip7ho2px2prhq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48527/
State Superseded
Headers show

Comments

phabricator - March 13, 2021, 7:34 p.m.
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

Patch

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