[PATCH 5 of 6] py3: do not mutate dict while iterating in tagmerge

Yuya Nishihara yuya at tcha.org
Sun Mar 4 16:41:40 EST 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1520198026 18000
#      Sun Mar 04 16:13:46 2018 -0500
# Node ID 8267c6e887a9473e849faf2ac2ab439b9cbffcbf
# Parent  8fe5cf00bb5e51dadafa1811c9fc1aeb2fdb47d4
py3: do not mutate dict while iterating in tagmerge

diff --git a/mercurial/tagmerge.py b/mercurial/tagmerge.py
--- a/mercurial/tagmerge.py
+++ b/mercurial/tagmerge.py
@@ -146,7 +146,7 @@ def writemergedtags(fcd, mergedtags):
     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 @@ def merge(repo, fcd, fco, fca):
     writemergedtags(fcd, mergedtags)
     ui.note(_('.hgtags merged successfully\n'))
     return False, 0
-


More information about the Mercurial-devel mailing list