Mercurial > public > mercurial-scm > hg-stable
diff mercurial/scmutil.py @ 23533:891aaa7c0c70
scmutil: pass a matcher to scmutil.addremove() instead of a list of patterns
This will make it easier to support subrepository operations.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 09 Nov 2014 19:57:02 -0500 |
parents | 94091ab9d112 |
children | 83bbedc16b3f |
line wrap: on
line diff
--- a/mercurial/scmutil.py Wed Dec 10 23:46:47 2014 -0500 +++ b/mercurial/scmutil.py Sun Nov 09 19:57:02 2014 -0500 @@ -713,13 +713,13 @@ '''Return a matcher that will efficiently match exactly these files.''' return matchmod.exact(repo.root, repo.getcwd(), files) -def addremove(repo, pats=[], opts={}, dry_run=None, similarity=None): +def addremove(repo, matcher, opts={}, dry_run=None, similarity=None): + m = matcher if dry_run is None: dry_run = opts.get('dry_run') if similarity is None: similarity = float(opts.get('similarity') or 0) - # we'd use status here, except handling of symlinks and ignore is tricky - m = match(repo[None], pats, opts) + rejected = [] m.bad = lambda x, y: rejected.append(x)