# HG changeset patch # User Mads Kiilerich # Date 1408070266 -7200 # Node ID 269688a398c4da99746da17afa2029d316d57b88 # Parent b27c3beaaf30bcb4713d2aea5e5dc5fdbc1b768d cleanup: fix some list comprehension redefinitions of existing vars In all the remaining cases the comprehension variable is used for the same thing as a previous loop variable. This will mute some pyflakes "list comprehension redefines" warnings. diff -r b27c3beaaf30 -r 269688a398c4 hgext/convert/subversion.py --- a/hgext/convert/subversion.py Fri Aug 15 16:20:47 2014 +0200 +++ b/hgext/convert/subversion.py Fri Aug 15 04:37:46 2014 +0200 @@ -490,10 +490,10 @@ self._fetch_revisions(revnum, stop) if rev not in self.commits: raise util.Abort(_('svn: revision %s not found') % revnum) - commit = self.commits[rev] + revcommit = self.commits[rev] # caller caches the result, so free it here to release memory del self.commits[rev] - return commit + return revcommit def checkrevformat(self, revstr, mapname='splicemap'): """ fails if revision format does not match the correct format""" diff -r b27c3beaaf30 -r 269688a398c4 mercurial/commands.py --- a/mercurial/commands.py Fri Aug 15 16:20:47 2014 +0200 +++ b/mercurial/commands.py Fri Aug 15 04:37:46 2014 +0200 @@ -5593,7 +5593,7 @@ ui.write(_('commit: %s\n') % t.strip()) # all ancestors of branch heads - all ancestors of parent = new csets - new = len(repo.changelog.findmissing([ctx.node() for ctx in parents], + new = len(repo.changelog.findmissing([pctx.node() for pctx in parents], bheads)) if new == 0: diff -r b27c3beaaf30 -r 269688a398c4 mercurial/context.py --- a/mercurial/context.py Fri Aug 15 16:20:47 2014 +0200 +++ b/mercurial/context.py Fri Aug 15 04:37:46 2014 +0200 @@ -735,9 +735,9 @@ return True def parents(self): - p = self._path + _path = self._path fl = self._filelog - pl = [(p, n, fl) for n in self._filelog.parents(self._filenode)] + pl = [(_path, n, fl) for n in self._filelog.parents(self._filenode)] r = self._filelog.renamed(self._filenode) if r: diff -r b27c3beaaf30 -r 269688a398c4 mercurial/localrepo.py --- a/mercurial/localrepo.py Fri Aug 15 16:20:47 2014 +0200 +++ b/mercurial/localrepo.py Fri Aug 15 04:37:46 2014 +0200 @@ -676,8 +676,7 @@ if not self._tagscache.tagslist: l = [] for t, n in self.tags().iteritems(): - r = self.changelog.rev(n) - l.append((r, t, n)) + l.append((self.changelog.rev(n), t, n)) self._tagscache.tagslist = [(t, n) for r, t, n in sorted(l)] return self._tagscache.tagslist diff -r b27c3beaaf30 -r 269688a398c4 mercurial/wireproto.py --- a/mercurial/wireproto.py Fri Aug 15 16:20:47 2014 +0200 +++ b/mercurial/wireproto.py Fri Aug 15 04:37:46 2014 +0200 @@ -249,7 +249,7 @@ yield {'nodes': encodelist(nodes)}, f d = f.value try: - yield [bool(int(f)) for f in d] + yield [bool(int(b)) for b in d] except ValueError: self._abort(error.ResponseError(_("unexpected response:"), d))