[PATCH 2 of 2] status: add terse option flag (issue4119)

Sean Farley sean at farley.io
Fri Mar 27 11:52:46 CDT 2015


Augie Fackler <raf at durin42.com> writes:

> On Tue, Mar 24, 2015 at 10:58:00PM -0700, Sean Farley wrote:
>>
>> Sean Farley <sean at farley.io> writes:
>>
>> > # HG changeset patch
>> > # User Sean Farley <sean at farley.io>
>> > # Date 1427261050 25200
>> > #      Tue Mar 24 22:24:10 2015 -0700
>> > # Node ID 1fc4b58112600db90c710f32a3ec6f5c4438d5df
>> > # Parent  f9e43618a84b4ce1de23c8cdf22de5e9bcadafdd
>> > status: add terse option flag (issue4119)
>> >
>> > Based on work by Martin Geisler, this patch adds the option to list only
>> > directories of untracked files. A test has been added.
>> >
>> > diff --git a/mercurial/commands.py b/mercurial/commands.py
>> > --- a/mercurial/commands.py
>> > +++ b/mercurial/commands.py
>> > @@ -5688,10 +5688,11 @@ class httpservice(object):
>> >      ('0', 'print0', None, _('end filenames with NUL, for use with xargs')),
>> >      ('', 'rev', [], _('show difference from revision'), _('REV')),
>> >      ('', 'change', '', _('list the changed files of a revision'), _('REV')),
>> >      ('', 'relative', None,
>> >       ('list the changed files relative to working directory')),
>> > +    ('t', 'terse', None, _('show only directory of unknown files')),
>> >      ] + walkopts + subrepoopts + formatteropts,
>> >      _('[OPTION]... [FILE]...'),
>> >      inferrepo=True)
>> >  def status(ui, repo, *pats, **opts):
>> >      """show changed files in the working directory
>> > @@ -5788,10 +5789,40 @@ def status(ui, repo, *pats, **opts):
>> >              show = states[:5]
>> >
>> >      stat = repo.status(node1, node2, scmutil.match(repo[node2], pats, opts),
>> >                         'ignored' in show, 'clean' in show, 'unknown' in show,
>> >                         opts.get('subrepos'))
>> > +
>> > +    if 'unknown' in show and opts.get('terse'):
>> > +        knowndirs = set(['']) # root is always known
>> > +        results = set()
>> > +
>> > +        # gather known directories
>> > +        for path in repo[node1]:
>>
>> Whoops, this should be repo[None] so we can avoid reading obs markers.
>
> I assume we expect a v2 of this patch? I don't know if I missed any
> IRC discussion surrounding it.

Yep, working on it now. There was some IRC discussion with bikeshedding
and I'll send out a RFC soon.


More information about the Mercurial-devel mailing list