py3: don't use dict.iterkeys()
authorPulkit Goyal <pulkit@yandex-team.ru>
Tue, 13 Nov 2018 18:08:17 +0300
changeset 40613 9769e0f6ffe0
parent 40612 3fa4183e7803
child 40614 aa588bf40a08
py3: don't use dict.iterkeys() dict.iterkeys() is not present on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5262
hgext/remotefilelog/basepack.py
hgext/remotefilelog/fileserverclient.py
hgext/remotefilelog/remotefilelog.py
hgext/remotefilelog/repack.py
--- a/hgext/remotefilelog/basepack.py	Tue Nov 13 18:07:21 2018 +0300
+++ b/hgext/remotefilelog/basepack.py	Tue Nov 13 18:08:17 2018 +0300
@@ -468,7 +468,7 @@
         # Precompute the location of each entry
         locations = {}
         count = 0
-        for node in sorted(self.entries.iterkeys()):
+        for node in sorted(self.entries):
             location = count * self.INDEXENTRYLENGTH
             locations[node] = location
             count += 1
--- a/hgext/remotefilelog/fileserverclient.py	Tue Nov 13 18:07:21 2018 +0300
+++ b/hgext/remotefilelog/fileserverclient.py	Tue Nov 13 18:08:17 2018 +0300
@@ -340,7 +340,7 @@
             missingid = cache.receiveline()
             if not missingid:
                 missedset = set(missed)
-                for missingid in idmap.iterkeys():
+                for missingid in idmap:
                     if not missingid in missedset:
                         missed.append(missingid)
                 self.ui.warn(_("warning: cache connection closed early - " +
--- a/hgext/remotefilelog/remotefilelog.py	Tue Nov 13 18:07:21 2018 +0300
+++ b/hgext/remotefilelog/remotefilelog.py	Tue Nov 13 18:08:17 2018 +0300
@@ -419,7 +419,7 @@
         # Breadth first traversal to build linkrev graph
         parentrevs = collections.defaultdict(list)
         revmap = {}
-        queue = collections.deque(((None, n) for n in parentsmap.iterkeys()
+        queue = collections.deque(((None, n) for n in parentsmap
                  if n not in allparents))
         while queue:
             prevrev, current = queue.pop()
--- a/hgext/remotefilelog/repack.py	Tue Nov 13 18:07:21 2018 +0300
+++ b/hgext/remotefilelog/repack.py	Tue Nov 13 18:08:17 2018 +0300
@@ -507,7 +507,7 @@
                         total=len(byfile))
 
             ancestors = {}
-            nodes = list(node for node in entries.iterkeys())
+            nodes = list(node for node in entries)
             nohistory = []
             for i, node in enumerate(nodes):
                 if node in ancestors:
@@ -643,7 +643,7 @@
         count = 0
         for filename, entries in sorted(byfile.iteritems()):
             ancestors = {}
-            nodes = list(node for node in entries.iterkeys())
+            nodes = list(node for node in entries)
 
             for node in nodes:
                 if node in ancestors: