D7292: changegroup: avoid shadowing a set with an int

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Nov 6 23:01:07 UTC 2019


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

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(



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


More information about the Mercurial-devel mailing list