Mercurial > hg-stable
changeset 18815:a18919de61e5
dirstate.walk: fast path none-seen + match-always case for step 3
This case is a common one -- e.g. `hg diff`.
For a repository with 170,000 files, this speeds up perfstatus from 0.95
seconds to 0.88.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 22 Mar 2013 17:03:49 -0700 |
parents | 1413ba410244 |
children | 7f7d5f8a8f15 |
files | mercurial/dirstate.py |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/dirstate.py Fri Mar 22 17:03:00 2013 -0700 +++ b/mercurial/dirstate.py Fri Mar 22 17:03:49 2013 -0700 @@ -705,7 +705,12 @@ # step 3: report unseen items in the dmap hash if not skipstep3 and not exact: - visit = sorted([f for f in dmap if f not in results and matchfn(f)]) + if not results and matchalways: + visit = dmap.keys() + else: + visit = [f for f in dmap if f not in results and matchfn(f)] + visit.sort() + if unknown: # unknown == True means we walked the full directory tree above. # So if a file is not seen it was either a) not matching matchfn