# HG changeset patch # User Gregory Szorc # Date 1518396989 28800 # Node ID c02771617a70bb662a776306330ce4ef752f0718 # Parent b587a889b97ead86dd3bb2125b47588d2d371779 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 diff -r b587a889b97e -r c02771617a70 mercurial/copies.py --- 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]