mirror of
https://github.com/facebook/sapling.git
synced 2024-12-29 08:02:24 +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,
|
bundle2,
|
||||||
changegroup,
|
changegroup,
|
||||||
cmdutil,
|
cmdutil,
|
||||||
|
context,
|
||||||
copies,
|
copies,
|
||||||
destutil,
|
destutil,
|
||||||
dirstateguard,
|
dirstateguard,
|
||||||
@ -45,6 +46,7 @@ from .. import (
|
|||||||
hg,
|
hg,
|
||||||
hintutil,
|
hintutil,
|
||||||
lock as lockmod,
|
lock as lockmod,
|
||||||
|
match as matchmod,
|
||||||
merge as mergemod,
|
merge as mergemod,
|
||||||
mutation,
|
mutation,
|
||||||
obsolete,
|
obsolete,
|
||||||
@ -2242,6 +2244,9 @@ def files(ui, repo, *pats, **opts):
|
|||||||
fmt = "%s" + end
|
fmt = "%s" + end
|
||||||
|
|
||||||
m = scmutil.match(ctx, pats, opts)
|
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")
|
ui.pager("files")
|
||||||
with ui.formatter("files", opts) as fm:
|
with ui.formatter("files", opts) as fm:
|
||||||
return cmdutil.files(ui, ctx, m, fm, fmt)
|
return cmdutil.files(ui, ctx, m, fm, fmt)
|
||||||
|
@ -87,6 +87,8 @@ Verify commiting while sparse includes other files
|
|||||||
$ hg manifest
|
$ hg manifest
|
||||||
hide
|
hide
|
||||||
show
|
show
|
||||||
|
$ hg files
|
||||||
|
hide
|
||||||
|
|
||||||
Verify --reset brings files back
|
Verify --reset brings files back
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user