Mercurial > hg
comparison mercurial/commands.py @ 24413:a8595176dd64
subrepo: add basic support to hgsubrepo for the files command
Paths into the subrepo are not yet supported.
The need to use the workingctx in the subrepo will likely be used more in the
future, with the proposed working directory revset symbol. It is also needed
with archive, if that code is to be reused to support 'extdiff -S'.
Unfortunately, it doesn't seem possible to put the smarts in subrepo.subrepo(),
as it breaks various status and diff tests.
I opted not to pass the desired revision into the subrepo method explicitly,
because the only ones that do pass an explicit revision are methods like status
and diff, which actually operate on two contexts- the subrepo state and the
explicitly passed revision.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 18 Mar 2015 23:03:41 -0400 |
parents | 03c84c966ef5 |
children | 77881cade20e |
comparison
equal
deleted
inserted
replaced
24409:30b8db6d0c04 | 24413:a8595176dd64 |
---|---|
3223 opts=patch.diffallopts(ui, opts)) | 3223 opts=patch.diffallopts(ui, opts)) |
3224 | 3224 |
3225 @command('files', | 3225 @command('files', |
3226 [('r', 'rev', '', _('search the repository as it is in REV'), _('REV')), | 3226 [('r', 'rev', '', _('search the repository as it is in REV'), _('REV')), |
3227 ('0', 'print0', None, _('end filenames with NUL, for use with xargs')), | 3227 ('0', 'print0', None, _('end filenames with NUL, for use with xargs')), |
3228 ] + walkopts + formatteropts, | 3228 ] + walkopts + formatteropts + subrepoopts, |
3229 _('[OPTION]... [PATTERN]...')) | 3229 _('[OPTION]... [PATTERN]...')) |
3230 def files(ui, repo, *pats, **opts): | 3230 def files(ui, repo, *pats, **opts): |
3231 """list tracked files | 3231 """list tracked files |
3232 | 3232 |
3233 Print files under Mercurial control in the working directory or | 3233 Print files under Mercurial control in the working directory or |
3278 end = '\0' | 3278 end = '\0' |
3279 fm = ui.formatter('files', opts) | 3279 fm = ui.formatter('files', opts) |
3280 fmt = '%s' + end | 3280 fmt = '%s' + end |
3281 | 3281 |
3282 m = scmutil.match(ctx, pats, opts) | 3282 m = scmutil.match(ctx, pats, opts) |
3283 ret = cmdutil.files(ui, ctx, m, fm, fmt) | 3283 ret = cmdutil.files(ui, ctx, m, fm, fmt, opts.get('subrepos')) |
3284 | 3284 |
3285 fm.end() | 3285 fm.end() |
3286 | 3286 |
3287 return ret | 3287 return ret |
3288 | 3288 |