py3: do not mutate dict while iterating in tagmerge
authorYuya Nishihara <yuya@tcha.org>
Sun, 04 Mar 2018 16:13:46 -0500
changeset 36733 66250de006c6
parent 36732 723e87c8c059
child 36734 b77ff4fbe9ad
py3: do not mutate dict while iterating in tagmerge
mercurial/tagmerge.py
--- a/mercurial/tagmerge.py	Sun Mar 04 16:01:18 2018 -0500
+++ b/mercurial/tagmerge.py	Sun Mar 04 16:13:46 2018 -0500
@@ -146,7 +146,7 @@
     possible to the first parent's .hgtags file.
     '''
     # group the node-tag pairs that must be written next to each other
-    for tname, taglist in mergedtags.items():
+    for tname, taglist in list(mergedtags.items()):
         mergedtags[tname] = grouptagnodesbyline(taglist)
 
     # convert the grouped merged tags dict into a format that resembles the
@@ -269,4 +269,3 @@
     writemergedtags(fcd, mergedtags)
     ui.note(_('.hgtags merged successfully\n'))
     return False, 0
-