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.
--- 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):