mercurial/discovery.py
changeset 43106 d783f945a701
parent 43077 687b865b95ad
child 43117 8ff1ecfadcd1
--- a/mercurial/discovery.py	Sun Oct 06 19:25:18 2019 -0400
+++ b/mercurial/discovery.py	Mon Oct 07 00:04:04 2019 -0400
@@ -21,6 +21,7 @@
     branchmap,
     error,
     phases,
+    pycompat,
     scmutil,
     setdiscovery,
     treediscovery,
@@ -226,7 +227,7 @@
 
     knownnode = cl.hasnode  # do not use nodemap until it is filtered
     # A. register remote heads of branches which are in outgoing set
-    for branch, heads in remotemap.iteritems():
+    for branch, heads in pycompat.iteritems(remotemap):
         # don't add head info about branches which we don't have locally
         if branch not in branches:
             continue
@@ -248,13 +249,13 @@
     # This will possibly add new heads and remove existing ones.
     newmap = branchmap.remotebranchcache(
         (branch, heads[1])
-        for branch, heads in headssum.iteritems()
+        for branch, heads in pycompat.iteritems(headssum)
         if heads[0] is not None
     )
     newmap.update(repo, (ctx.rev() for ctx in missingctx))
-    for branch, newheads in newmap.iteritems():
+    for branch, newheads in pycompat.iteritems(newmap):
         headssum[branch][1][:] = newheads
-    for branch, items in headssum.iteritems():
+    for branch, items in pycompat.iteritems(headssum):
         for l in items:
             if l is not None:
                 l.sort()
@@ -266,7 +267,7 @@
         futureheads = set(torev(h) for h in outgoing.missingheads)
         futureheads |= set(torev(h) for h in outgoing.commonheads)
         allfuturecommon = repo.changelog.ancestors(futureheads, inclusive=True)
-        for branch, heads in sorted(headssum.iteritems()):
+        for branch, heads in sorted(pycompat.iteritems(headssum)):
             remoteheads, newheads, unsyncedheads, placeholder = heads
             result = _postprocessobsolete(pushop, allfuturecommon, newheads)
             headssum[branch] = (
@@ -362,7 +363,9 @@
         headssum = _oldheadssummary(repo, remoteheads, outgoing, inc)
     pushop.pushbranchmap = headssum
     newbranches = [
-        branch for branch, heads in headssum.iteritems() if heads[0] is None
+        branch
+        for branch, heads in pycompat.iteritems(headssum)
+        if heads[0] is None
     ]
     # 1. Check for new branches on the remote.
     if newbranches and not newbranch:  # new branch requires --new-branch
@@ -390,7 +393,7 @@
     # If there are more heads after the push than before, a suitable
     # error message, depending on unsynced status, is displayed.
     errormsg = None
-    for branch, heads in sorted(headssum.iteritems()):
+    for branch, heads in sorted(pycompat.iteritems(headssum)):
         remoteheads, newheads, unsyncedheads, discardedheads = heads
         # add unsynced data
         if remoteheads is None: