Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 24955:1df233bcb7f6
remove: use ctx.hasdir(f) instead of 'f in ctx.dirs()'
This speeds up 'hg remove python/README' on the Firefox repo from
2.479s to 0.664s with lazily loaded treemanifests (which is not yet in
core) and has no measurable effect on flat manifests.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 21 Apr 2015 09:29:59 -0700 |
parents | a02d293a1079 |
children | fb9b7b937b3e |
comparison
equal
deleted
inserted
replaced
24954:e47feee55bf7 | 24955:1df233bcb7f6 |
---|---|
2334 for subpath in wctx.substate: | 2334 for subpath in wctx.substate: |
2335 if f.startswith(subpath): | 2335 if f.startswith(subpath): |
2336 return True | 2336 return True |
2337 return False | 2337 return False |
2338 | 2338 |
2339 isdir = f in deleteddirs or f in wctx.dirs() | 2339 isdir = f in deleteddirs or wctx.hasdir(f) |
2340 if f in repo.dirstate or isdir or f == '.' or insubrepo(): | 2340 if f in repo.dirstate or isdir or f == '.' or insubrepo(): |
2341 continue | 2341 continue |
2342 | 2342 |
2343 if repo.wvfs.exists(f): | 2343 if repo.wvfs.exists(f): |
2344 if repo.wvfs.isdir(f): | 2344 if repo.wvfs.isdir(f): |