py3: switch from iteritems() to items()
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 03 Jul 2019 11:13:47 -0700
changeset 4714 c51fc0ae7a7e
parent 4713 fbe7f35a6926
child 4715 12c8b24757f4
py3: switch from iteritems() to items()
hgext3rd/evolve/cmdrewrite.py
hgext3rd/evolve/compat.py
hgext3rd/evolve/evolvecmd.py
hgext3rd/evolve/exthelper.py
hgext3rd/evolve/legacy.py
hgext3rd/evolve/obsexchange.py
hgext3rd/evolve/rewriteutil.py
hgext3rd/evolve/thirdparty/cbor.py
--- a/hgext3rd/evolve/cmdrewrite.py	Wed Jul 03 11:37:29 2019 -0700
+++ b/hgext3rd/evolve/cmdrewrite.py	Wed Jul 03 11:13:47 2019 -0700
@@ -320,7 +320,7 @@
 
     # Filter copies
     copied = copies.pathcopies(target, ctx)
-    copied = dict((dst, src) for dst, src in copied.iteritems()
+    copied = dict((dst, src) for dst, src in copied.items()
                   if dst in files)
 
     def filectxfn(repo, memctx, path, contentctx=ctx, redirect=newcontent):
@@ -441,9 +441,9 @@
             oldcopies[f] = src[0]
     oldcopies.update(copies)
     copies = dict((dst, oldcopies.get(src, src))
-                  for dst, src in oldcopies.iteritems())
+                  for dst, src in oldcopies.items())
     # Adjust the dirstate copies
-    for dst, src in copies.iteritems():
+    for dst, src in copies.items():
         if (src not in ctx or dst in ctx or ds[dst] != 'a'):
             src = None
         ds.copy(src, dst)
--- a/hgext3rd/evolve/compat.py	Wed Jul 03 11:37:29 2019 -0700
+++ b/hgext3rd/evolve/compat.py	Wed Jul 03 11:13:47 2019 -0700
@@ -371,7 +371,7 @@
 
     # examine each file copy for a potential directory move, which is
     # when all the files in a directory are moved to a new directory
-    for dst, src in fullcopy.iteritems():
+    for dst, src in fullcopy.items():
         dsrc, ddst = pathutil.dirname(src), pathutil.dirname(dst)
         if dsrc in invalid:
             # already seen to be uninteresting
--- a/hgext3rd/evolve/evolvecmd.py	Wed Jul 03 11:37:29 2019 -0700
+++ b/hgext3rd/evolve/evolvecmd.py	Wed Jul 03 11:13:47 2019 -0700
@@ -1478,7 +1478,7 @@
                 continue
             base[tuple(nsuccset)] = n
     divergence = []
-    for divset, b in base.iteritems():
+    for divset, b in base.items():
         divergence.append({
             'divergentnodes': divset,
             'commonprecursor': b
@@ -1838,7 +1838,7 @@
         # boolean value to say whether we should strip or not
         cleanup = True
         startnode = evolvestate['startnode']
-        for old, new in evolvestate['replacements'].iteritems():
+        for old, new in evolvestate['replacements'].items():
             if new:
                 evolvedctx.append(repo[new])
         for temp in evolvestate['temprevs']:
--- a/hgext3rd/evolve/exthelper.py	Wed Jul 03 11:37:29 2019 -0700
+++ b/hgext3rd/evolve/exthelper.py	Wed Jul 03 11:13:47 2019 -0700
@@ -111,7 +111,7 @@
         self._functionwrappers.extend(other._functionwrappers)
         self._duckpunchers.extend(other._duckpunchers)
         self.cmdtable.update(other.cmdtable)
-        for section, items in other.configtable.iteritems():
+        for section, items in other.configtable.items():
             if section in self.configtable:
                 self.configtable[section].update(items)
             else:
--- a/hgext3rd/evolve/legacy.py	Wed Jul 03 11:37:29 2019 -0700
+++ b/hgext3rd/evolve/legacy.py	Wed Jul 03 11:13:47 2019 -0700
@@ -139,7 +139,7 @@
 
                     oldmark['date'] = '%i %i' % tuple(oldmark['date'])
                     meta = dict((k.encode('utf-8'), v.encode('utf-8'))
-                                for k, v in oldmark.iteritems())
+                                for k, v in oldmark.items())
                     try:
                         succs = [bin(n) for n in oldsubjects]
                         succs = [n for n in succs if n != nullid]
--- a/hgext3rd/evolve/obsexchange.py	Wed Jul 03 11:37:29 2019 -0700
+++ b/hgext3rd/evolve/obsexchange.py	Wed Jul 03 11:13:47 2019 -0700
@@ -221,7 +221,7 @@
         from mercurial import wireproto as wireprototypes
         wireprotov1server = wireprototypes
     opts = wireprotov1server.options('', ['heads', 'common'], others)
-    for k, v in opts.iteritems():
+    for k, v in opts.items():
         if k in ('heads', 'common'):
             opts[k] = wireprototypes.decodelist(v)
     obsdata = _getobsmarkersstream(repo, **opts)
--- a/hgext3rd/evolve/rewriteutil.py	Wed Jul 03 11:37:29 2019 -0700
+++ b/hgext3rd/evolve/rewriteutil.py	Wed Jul 03 11:13:47 2019 -0700
@@ -150,7 +150,7 @@
     # a revision we have to only delete the bookmark and not strip
     # anything. revsets cannot detect that case.
     nodetobookmarks = {}
-    for mark, bnode in repomarks.iteritems():
+    for mark, bnode in repomarks.items():
         nodetobookmarks.setdefault(bnode, []).append(mark)
     for marks in nodetobookmarks.values():
         if bookmarks.issuperset(marks):
--- a/hgext3rd/evolve/thirdparty/cbor.py	Wed Jul 03 11:37:29 2019 -0700
+++ b/hgext3rd/evolve/thirdparty/cbor.py	Wed Jul 03 11:13:47 2019 -0700
@@ -193,7 +193,7 @@
                 parts.append(dumps(k, sort_keys=sort_keys))
                 parts.append(dumps(v, sort_keys=sort_keys))
         else:
-            for k,v in d.iteritems():
+            for k,v in d.items():
                 parts.append(dumps(k, sort_keys=sort_keys))
                 parts.append(dumps(v, sort_keys=sort_keys))
         return b''.join(parts)