py3: avoid changing dictionary during iteration
dict.items() and friends are iterators/views in Python 3. You
aren't allowed to mutate the underlying dictionary when iterating
on these views. So iterate over a copy of things.
Differential Revision: https://phab.mercurial-scm.org/D2164
--- a/mercurial/copies.py Sun Feb 11 16:54:56 2018 -0800
+++ b/mercurial/copies.py Sun Feb 11 16:56:29 2018 -0800
@@ -123,7 +123,7 @@
t[k] = v
# remove criss-crossed copies
- for k, v in t.items():
+ for k, v in list(t.items()):
if k in src and v in dst:
del t[k]