Mercurial > public > mercurial-scm > hg
comparison mercurial/patch.py @ 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 | 72b91f905065 |
children | a981ab2a1b4c |
comparison
equal
deleted
inserted
replaced
35588:dadbf213a765 | 35589:3328d53254d9 |
---|---|
2441 # They are not in ctx1, so We don't want to show them in the diff. | 2441 # They are not in ctx1, so We don't want to show them in the diff. |
2442 removedset.remove(f) | 2442 removedset.remove(f) |
2443 modified = sorted(modifiedset) | 2443 modified = sorted(modifiedset) |
2444 added = sorted(addedset) | 2444 added = sorted(addedset) |
2445 removed = sorted(removedset) | 2445 removed = sorted(removedset) |
2446 for dst, src in copy.items(): | 2446 for dst, src in list(copy.items()): |
2447 if src not in ctx1: | 2447 if src not in ctx1: |
2448 # Files merged in during a merge and then copied/renamed are | 2448 # Files merged in during a merge and then copied/renamed are |
2449 # reported as copies. We want to show them in the diff as additions. | 2449 # reported as copies. We want to show them in the diff as additions. |
2450 del copy[dst] | 2450 del copy[dst] |
2451 | 2451 |