localrepo: forcibly copy list of filecache keys
authorAugie Fackler <augie@google.com>
Sun, 19 Mar 2017 01:11:00 -0400
changeset 31510 2244fb3eee49
parent 31509 5c9936193145
child 31511 fa8aaff2001a
localrepo: forcibly copy list of filecache keys On Python 3, keys() is more like iterkeys(), so we got in trouble for mutating the dict while we're iterating here. Since the list of caches should be relatively small, work around this difference by just forcing a copy of the key list.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sun Mar 19 01:10:02 2017 -0400
+++ b/mercurial/localrepo.py	Sun Mar 19 01:11:00 2017 -0400
@@ -1318,7 +1318,7 @@
         redundant one doesn't).
         '''
         unfiltered = self.unfiltered() # all file caches are stored unfiltered
-        for k in self._filecache.keys():
+        for k in list(self._filecache.keys()):
             # dirstate is invalidated separately in invalidatedirstate()
             if k == 'dirstate':
                 continue