changeset 18861:ec91b66e8965

scmutil.addremove: pull repo.dirstate fetch out of the loop On a large repository with 170,000 files, this speeds up perfaddremove from 2.78 seconds to 2.40.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 02 Apr 2013 14:46:55 -0700
parents ce83afefa980
children 6de8cd5c719a
files mercurial/scmutil.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Mon Apr 01 20:38:37 2013 -0700
+++ b/mercurial/scmutil.py	Tue Apr 02 14:46:55 2013 -0700
@@ -676,10 +676,11 @@
     m.bad = lambda x, y: rejected.append(x)
 
     ctx = repo[None]
-    walkresults = repo.dirstate.walk(m, sorted(ctx.substate), True, False)
+    dirstate = repo.dirstate
+    walkresults = dirstate.walk(m, sorted(ctx.substate), True, False)
     for abs in sorted(walkresults):
         st = walkresults[abs]
-        dstate = repo.dirstate[abs]
+        dstate = dirstate[abs]
         if dstate == '?' and audit_path.check(abs):
             unknown.append(abs)
             if repo.ui.verbose or not m.exact(abs):