Mercurial > hg
comparison hgext/narrow/narrowcommands.py @ 36100:8fd0a9e2d7e9
narrow: make restrictpatterns a little more idiomatic
I'm not sure why invalid_includes was an out-param, but it doesn't
look like there's any reason for it to be now.
Differential Revision: https://phab.mercurial-scm.org/D2192
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 12 Feb 2018 14:42:47 -0500 |
parents | 8c31187b6717 |
children | 4a7ba3ac9163 |
comparison
equal
deleted
inserted
replaced
36099:b8bbe589fd47 | 36100:8fd0a9e2d7e9 |
---|---|
132 """Wraps archive command to narrow the default includes.""" | 132 """Wraps archive command to narrow the default includes.""" |
133 if narrowrepo.REQUIREMENT in repo.requirements: | 133 if narrowrepo.REQUIREMENT in repo.requirements: |
134 repo_includes, repo_excludes = repo.narrowpats | 134 repo_includes, repo_excludes = repo.narrowpats |
135 includes = set(opts.get('include', [])) | 135 includes = set(opts.get('include', [])) |
136 excludes = set(opts.get('exclude', [])) | 136 excludes = set(opts.get('exclude', [])) |
137 includes, excludes = narrowspec.restrictpatterns( | 137 includes, excludes, unused_invalid = narrowspec.restrictpatterns( |
138 includes, excludes, repo_includes, repo_excludes) | 138 includes, excludes, repo_includes, repo_excludes) |
139 if includes: | 139 if includes: |
140 opts['include'] = includes | 140 opts['include'] = includes |
141 if excludes: | 141 if excludes: |
142 opts['exclude'] = excludes | 142 opts['exclude'] = excludes |