From patchwork Tue Aug 29 15:21:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2, of, 7] python3: replace sorted(.iterkeys()) with sorted() From: Augie Fackler X-Patchwork-Id: 23470 Message-Id: <6a943a24d442ada9411c.1504020119@augie-macbookpro2.roam.corp.google.com> To: mercurial-devel@mercurial-scm.org Date: Tue, 29 Aug 2017 11:21:59 -0400 # HG changeset patch # User Augie Fackler # Date 1503446818 14400 # Tue Aug 22 20:06:58 2017 -0400 # Node ID 6a943a24d442ada9411c1d27dfe7d0250c3974f1 # Parent fd4664b32ec7cae6dbfdd6292c04e7f1a4888da2 python3: replace sorted(.iterkeys()) with sorted() diff --git a/contrib/synthrepo.py b/contrib/synthrepo.py --- a/contrib/synthrepo.py +++ b/contrib/synthrepo.py @@ -479,7 +479,7 @@ def synthesize(ui, repo, descpath, **opt date = min(0x7fffffff, max(0, date)) user = random.choice(words) + '@' + random.choice(words) mc = context.memctx(repo, pl, makeline(minimum=2), - sorted(changes.iterkeys()), + sorted(changes), filectxfn, user, '%d %d' % (date, pick(tzoffset))) newnode = mc.commit() heads.add(repo.changelog.rev(newnode)) diff --git a/mercurial/filelog.py b/mercurial/filelog.py --- a/mercurial/filelog.py +++ b/mercurial/filelog.py @@ -31,7 +31,7 @@ def parsemeta(text): return meta, (s + 2) def packmeta(meta, text): - keys = sorted(meta.iterkeys()) + keys = sorted(meta) metatext = "".join("%s: %s\n" % (k, meta[k]) for k in keys) return "\1\n%s\1\n%s" % (metatext, text) diff --git a/tests/test-hgweb-auth.py b/tests/test-hgweb-auth.py --- a/tests/test-hgweb-auth.py +++ b/tests/test-hgweb-auth.py @@ -25,7 +25,7 @@ def writeauth(items): def dumpdict(dict): return '{' + ', '.join(['%s: %s' % (k, dict[k]) - for k in sorted(dict.iterkeys())]) + '}' + for k in sorted(dict)]) + '}' def test(auth, urls=None): print('CFG:', dumpdict(auth))