changeset 17210:ec80ae982689

_updatebranchcache: prevent deleting dict key during iteration We use dict.keys() to fetch all keys before starting to delete some. Otherwise python complains that the dictionnary is altered during iteration.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 17 Jul 2012 16:16:17 +0200
parents 5cd3e526ac37
children 4f321eecbf8d
files mercurial/localrepo.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Jul 17 18:21:49 2012 +0200
+++ b/mercurial/localrepo.py	Tue Jul 17 16:16:17 2012 +0200
@@ -745,7 +745,7 @@
         # branch that ceased to exist may not be in newbranches because
         # newbranches is the set of candidate heads, which when you strip the
         # last commit in a branch will be the parent branch.
-        for branch in partial:
+        for branch in partial.keys():
             nodes = [head for head in partial[branch]
                      if self.changelog.hasnode(head)]
             if not nodes: