# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2017-12-29 00:03:36 # Node ID 3328d53254d9a0ddabb8e2df3d5b9bf22a539de3 # Parent dadbf213a765cd57beced6d00199b7a05e9abef0 py3: use list() to get a list of items using dict.items() dict.items() on Python 3 returns a generator over the values of the dictionary, hence we can't delete elements while iterating over dict.items() in Python 3. Differential Revision: https://phab.mercurial-scm.org/D1799 diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -2443,7 +2443,7 @@ def diffhunks(repo, node1=None, node2=No modified = sorted(modifiedset) added = sorted(addedset) removed = sorted(removedset) - for dst, src in copy.items(): + for dst, src in list(copy.items()): if src not in ctx1: # Files merged in during a merge and then copied/renamed are # reported as copies. We want to show them in the diff as additions.