diff mercurial/copies.py @ 34348:1a5abc45e2fa

py3: explicitly convert dict.keys() and dict.items() into a list Differential Revision: https://phab.mercurial-scm.org/D853
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 30 Sep 2017 15:45:15 +0530
parents 1826d695ad58
children d00910b286cd
line wrap: on
line diff
--- a/mercurial/copies.py	Sat Sep 30 18:02:53 2017 +0530
+++ b/mercurial/copies.py	Sat Sep 30 15:45:15 2017 +0530
@@ -141,7 +141,7 @@
 def _dirstatecopies(d):
     ds = d._repo.dirstate
     c = ds.copies().copy()
-    for k in c.keys():
+    for k in list(c):
         if ds[k] not in 'anm':
             del c[k]
     return c
@@ -494,7 +494,7 @@
     renamedelete = {}
     renamedeleteset = set()
     divergeset = set()
-    for of, fl in diverge.items():
+    for of, fl in list(diverge.items()):
         if len(fl) == 1 or of in c1 or of in c2:
             del diverge[of] # not actually divergent, or not a rename
             if of not in c1 and of not in c2: