Mercurial > hg
comparison mercurial/commands.py @ 22592:ff3ccc592af4
files: use ctx.matches instead of ctx.walk
ctx.matches() is an optimized form of ctx.walk() when we don't care about the
state of files on disk.
For a large repo, 'hg files > /dev/null' drops from 3.7 seconds to 2.3.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 30 Sep 2014 14:39:58 -0700 |
parents | 9fe33afc00b4 |
children | ec47d4fde26d |
comparison
equal
deleted
inserted
replaced
22591:9fe33afc00b4 | 22592:ff3ccc592af4 |
---|---|
3217 end = '\0' | 3217 end = '\0' |
3218 fm = ui.formatter('files', opts) | 3218 fm = ui.formatter('files', opts) |
3219 fmt = '%s' + end | 3219 fmt = '%s' + end |
3220 | 3220 |
3221 m = scmutil.match(ctx, pats, opts) | 3221 m = scmutil.match(ctx, pats, opts) |
3222 for f in ctx.walk(m): | 3222 for f in ctx.matches(m): |
3223 if rev is None and repo.dirstate[f] in 'r?!': | 3223 if rev is None and repo.dirstate[f] in 'r?!': |
3224 continue | 3224 continue |
3225 fm.startitem() | 3225 fm.startitem() |
3226 if ui.verbose: | 3226 if ui.verbose: |
3227 fc = ctx[f] | 3227 fc = ctx[f] |