addremove: don't do full walks
authorSiddharth Agarwal <sid0@fb.com>
Wed, 04 Sep 2013 18:42:55 -0700
changeset 19655 1d07bf106c2a
parent 19654 5e1083447f7f
child 19656 60ce14e41faf
addremove: don't do full walks Full walks are only necessary when the caller needs the list of clean files. addremove by definition doesn't need them. With this patch and an extension that produces a subset of results for dirstate.walk when full is False, on a repository with over 200,000 files, hg addremove drops from 2.8 seconds to 0.5.
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Thu Sep 05 11:45:27 2013 -0400
+++ b/mercurial/scmutil.py	Wed Sep 04 18:42:55 2013 -0700
@@ -755,7 +755,8 @@
 
     ctx = repo[None]
     dirstate = repo.dirstate
-    walkresults = dirstate.walk(matcher, sorted(ctx.substate), True, False)
+    walkresults = dirstate.walk(matcher, sorted(ctx.substate), True, False,
+                                full=False)
     for abs, st in walkresults.iteritems():
         dstate = dirstate[abs]
         if dstate == '?' and audit_path.check(abs):