Patchwork D7292: changegroup: avoid shadowing a set with an int

login
register
mail settings
Submitter phabricator
Date Nov. 6, 2019, 11:01 p.m.
Message ID <differential-rev-PHID-DREV-t7pf4obt7vrwm6ukn2lb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42843/
State Superseded
Headers show

Comments

phabricator - Nov. 6, 2019, 11:01 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This confuses the heck out of pytype, and I basically agree with it
  that this shadowing is confusing. There's a chance this causes some
  memory to be freed later, but I think it's probably not worth worrying
  about for now.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7292

AFFECTED FILES
  mercurial/changegroup.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -315,15 +315,15 @@ 
             )
             self.callback = progress.increment
 
-            efiles = set()
+            efilesset = set()
 
             def onchangelog(cl, node):
-                efiles.update(cl.readfiles(node))
+                efilesset.update(cl.readfiles(node))
 
             self.changelogheader()
             deltas = self.deltaiter()
             cgnodes = cl.addgroup(deltas, csmap, trp, addrevisioncb=onchangelog)
-            efiles = len(efiles)
+            efiles = len(efilesset)
 
             if not cgnodes:
                 repo.ui.develwarn(