mirror of
https://github.com/facebook/sapling.git
synced 2024-12-27 23:22:02 +03:00
files: make files respect sparse profile
Summary: A previous diff broke this. hg files should only print files that respect the current sparse profile. Let's fix that. Reviewed By: quark-zju Differential Revision: D18255444 fbshipit-source-id: 2c63fa5921ddaa00a8349a57ea610c53a3b35ded
This commit is contained in:
parent
e760386f49
commit
9cbb9a90b4
@ -30,6 +30,7 @@ from .. import (
|
||||
bundle2,
|
||||
changegroup,
|
||||
cmdutil,
|
||||
context,
|
||||
copies,
|
||||
destutil,
|
||||
dirstateguard,
|
||||
@ -45,6 +46,7 @@ from .. import (
|
||||
hg,
|
||||
hintutil,
|
||||
lock as lockmod,
|
||||
match as matchmod,
|
||||
merge as mergemod,
|
||||
mutation,
|
||||
obsolete,
|
||||
@ -2242,6 +2244,9 @@ def files(ui, repo, *pats, **opts):
|
||||
fmt = "%s" + end
|
||||
|
||||
m = scmutil.match(ctx, pats, opts)
|
||||
if isinstance(ctx, context.workingctx) and util.safehasattr(repo, "sparsematch"):
|
||||
m = matchmod.intersectmatchers(m, repo.sparsematch())
|
||||
|
||||
ui.pager("files")
|
||||
with ui.formatter("files", opts) as fm:
|
||||
return cmdutil.files(ui, ctx, m, fm, fmt)
|
||||
|
@ -87,6 +87,8 @@ Verify commiting while sparse includes other files
|
||||
$ hg manifest
|
||||
hide
|
||||
show
|
||||
$ hg files
|
||||
hide
|
||||
|
||||
Verify --reset brings files back
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user