From patchwork Wed Nov 6 23:01:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7292: changegroup: avoid shadowing a set with an int From: phabricator X-Patchwork-Id: 42843 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 6 Nov 2019 23:01:07 +0000 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 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(