fastest way to collect filenames in working dir

Christian Ebert blacktrash at gmx.net
Sun Oct 14 15:27:43 UTC 2007


Hello,

What is the recommended way to collect filenames (clean,
modified, added) in the working directory if the caller uses
walkopts? Via repo.status or repo.walk?

Simplified examples for comparison:

def collect(ui, repo, *pats, **opts):
    files, match, anypats = cmdutil.matchpats(repo, pats, opts)
    files = [f for src, f in repo.walk(files=files, match=match)
             if f in repo.dirstate]

vs.

def collect(ui, repo, *pats, **opts):
    files, match, anypats = cmdutil.matchpats(repo, pats, opts)
    status = repo.status(files=files, match=match, list_clean=True)
    modified, added, removed, deleted, unknown, ignored, clean = status
    files = modified + added + clean

Or is there a third and better alternative?

TIA

c
-- 
keyword extension for Mercurial (http://selenic.com/mercurial):
<http://www.blacktrash.org/hg/hgkeyword/> (0.9.2 backwards compatible)
Mercurial crew development repository + keyword extension:
<http://www.blacktrash.org/hg/hg-crew-keyword/>



More information about the Mercurial-devel mailing list