Mercurial > hg
changeset 35589:3328d53254d9
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
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 29 Dec 2017 05:33:36 +0530 |
parents | dadbf213a765 |
children | aaeba70d5cbe |
files | mercurial/patch.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/patch.py Fri Dec 29 05:31:27 2017 +0530 +++ b/mercurial/patch.py Fri Dec 29 05:33:36 2017 +0530 @@ -2443,7 +2443,7 @@ 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.