hgext/infinitepush/__init__.py
changeset 43105 649d3ac37a12
parent 43089 c59eb1560c44
child 43111 e5d535621ee1
--- a/hgext/infinitepush/__init__.py	Sun Oct 06 17:59:15 2019 -0400
+++ b/hgext/infinitepush/__init__.py	Sun Oct 06 19:25:18 2019 -0400
@@ -378,7 +378,7 @@
 
 def wireprotolistkeyspatterns(repo, proto, namespace, patterns):
     patterns = wireprototypes.decodelist(patterns)
-    d = repo.listkeys(encoding.tolocal(namespace), patterns).iteritems()
+    d = pycompat.iteritems(repo.listkeys(encoding.tolocal(namespace), patterns))
     return pushkey.encodekeys(d)
 
 
@@ -392,7 +392,7 @@
             if pattern.endswith(b'*'):
                 pattern = b're:^' + pattern[:-1] + b'.*'
             kind, pat, matcher = stringutil.stringmatcher(pattern)
-            for bookmark, node in bookmarks.iteritems():
+            for bookmark, node in pycompat.iteritems(bookmarks):
                 if matcher(bookmark):
                     results[bookmark] = node
         return results
@@ -514,7 +514,7 @@
                     if part.type == b'changegroup':
                         haschangegroup = True
                     newpart = bundle2.bundlepart(part.type, data=part.read())
-                    for key, value in part.params.iteritems():
+                    for key, value in pycompat.iteritems(part.params):
                         newpart.addparam(key, value)
                     parts.append(newpart)
 
@@ -757,7 +757,7 @@
             # saveremotenames expects 20 byte binary nodes for branches
             branches[rname].append(bin(hexnode))
 
-    for bookmark, hexnode in newbookmarks.iteritems():
+    for bookmark, hexnode in pycompat.iteritems(newbookmarks):
         bookmarks[bookmark] = hexnode
     remotenamesext.saveremotenames(repo, remotepath, branches, bookmarks)
 
@@ -767,7 +767,7 @@
         return
     with repo.wlock(), repo.lock(), repo.transaction(b'bookmark') as tr:
         changes = []
-        for scratchbook, node in bookmarks.iteritems():
+        for scratchbook, node in pycompat.iteritems(bookmarks):
             changectx = repo[node]
             changes.append((scratchbook, changectx.node()))
         repo._bookmarks.applychanges(repo, tr, changes)
@@ -1005,7 +1005,7 @@
                 bundle2._processpart(op, part)
             else:
                 bundlepart = bundle2.bundlepart(part.type, data=part.read())
-                for key, value in part.params.iteritems():
+                for key, value in pycompat.iteritems(part.params):
                     bundlepart.addparam(key, value)
 
                 # Certain parts require a response
@@ -1092,7 +1092,7 @@
                     # differs from previous behavior, we need to put it behind a
                     # config flag for incremental rollout.
                     bundlepart = bundle2.bundlepart(part.type, data=part.read())
-                    for key, value in part.params.iteritems():
+                    for key, value in pycompat.iteritems(part.params):
                         bundlepart.addparam(key, value)
 
                     # Certain parts require a response
@@ -1273,7 +1273,9 @@
                 b'new': newnode,
                 b'old': oldnode,
             }
-            op.reply.newpart(b'pushkey', mandatoryparams=params.iteritems())
+            op.reply.newpart(
+                b'pushkey', mandatoryparams=pycompat.iteritems(params)
+            )
 
 
 def bundle2pushkey(orig, op, part):