py3: switch from iteritems() to items() in the topics extension
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 12 Jul 2019 23:24:04 -0700
changeset 4742 db3e7f6b5ceb
parent 4741 e8727a27e380
child 4743 92e3db149d7d
py3: switch from iteritems() to items() in the topics extension The only remaining iteritems() call is on branchmap. That will be dealt with in the next patch.
hgext3rd/topic/__init__.py
hgext3rd/topic/discovery.py
--- a/hgext3rd/topic/__init__.py	Sun Jul 14 22:34:36 2019 -0700
+++ b/hgext3rd/topic/__init__.py	Fri Jul 12 23:24:04 2019 -0700
@@ -813,7 +813,7 @@
     bmstore = repo._bookmarks
 
     nodetobook = {}
-    for book, revnode in bmstore.iteritems():
+    for book, revnode in bmstore.items():
         if nodetobook.get(revnode):
             nodetobook[revnode].append(book)
         else:
@@ -845,7 +845,7 @@
                 actions[(bookmark, revnum)] = targetrevs
 
         elif convertall:
-            for bmark, revnode in sorted(bmstore.iteritems()):
+            for bmark, revnode in sorted(bmstore.items()):
                 revnum = repo[revnode].rev()
                 if revnum in skipped:
                     continue
@@ -863,7 +863,7 @@
         if actions:
             try:
                 tr = repo.transaction('debugconvertbookmark')
-                for ((bmark, revnum), targetrevs) in sorted(actions.iteritems()):
+                for ((bmark, revnum), targetrevs) in sorted(actions.items()):
                     _applyconvertbmarktopic(ui, repo, targetrevs, revnum, bmark, tr)
                 tr.close()
             finally:
--- a/hgext3rd/topic/discovery.py	Sun Jul 14 22:34:36 2019 -0700
+++ b/hgext3rd/topic/discovery.py	Fri Jul 12 23:24:04 2019 -0700
@@ -110,7 +110,7 @@
         repo.unfiltered = lambda: unxx
         pushop.repo = repo
         summary = orig(pushop)
-        for key, value in summary.iteritems():
+        for key, value in summary.items():
             if ':' in key: # This is a topic
                 if value[0] is None and value[1]:
                     summary[key] = ([value[1][0]], ) + value[1:]
@@ -171,12 +171,12 @@
         if repo is not None:
             repo.invalidatecaches()
             finalheads = _nbheads(repo)
-            for branch, oldnb in tr._prepushheads.iteritems():
+            for branch, oldnb in tr._prepushheads.items():
                 newnb = finalheads.pop(branch, 0)
                 if oldnb < newnb:
                     msg = _('push create a new head on branch "%s"' % branch)
                     raise error.Abort(msg)
-            for branch, newnb in finalheads.iteritems():
+            for branch, newnb in finalheads.items():
                 if 1 < newnb:
                     msg = _('push create more than 1 head on new branch "%s"'
                             % branch)