changeset 18865:835e9dfd1e49

scmutil.addremove: use iteritems on walk results Now that we no longer sort all the walk results, using iteritems becomes possible. This is a relatively minor speedup: on a large repository with 170,000 files, perfaddremove goes from 2.13 seconds to 2.10.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 02 Apr 2013 14:50:50 -0700
parents 887b75fda169
children c7e8b143e086
files mercurial/scmutil.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Tue Apr 02 14:50:31 2013 -0700
+++ b/mercurial/scmutil.py	Tue Apr 02 14:50:50 2013 -0700
@@ -678,8 +678,7 @@
     ctx = repo[None]
     dirstate = repo.dirstate
     walkresults = dirstate.walk(m, sorted(ctx.substate), True, False)
-    for abs in walkresults:
-        st = walkresults[abs]
+    for abs, st in walkresults.iteritems():
         dstate = dirstate[abs]
         if dstate == '?' and audit_path.check(abs):
             unknown.append(abs)