[PATCH V2] status: add a flag to terse the output (issue4119)
Danek Duvall
danek.duvall at oracle.com
Mon Jun 19 17:15:33 EDT 2017
I'd like to see some text in the help output that talks about -t and its
arguments -- what are they, what do they mean, what it means to combine
them, how to disable them.
Pulkit Goyal wrote:
> @@ -4804,16 +4806,28 @@
> show = [k for k in states if opts.get(k)]
> if opts.get('all'):
> show += ui.quiet and (states[:4] + ['clean']) or states
> + if ui.quiet and terse:
> + for st in ('ignored', 'unknown'):
> + if st[0:1] in terse:
> + show.append(st)
> +
> if not show:
> if ui.quiet:
> show = states[:4]
> else:
> show = states[:5]
> + if terse:
> + for st in ('ignored', 'unknown', 'clean'):
> + if st[0:1] in terse:
> + show.append(st)
Is there a reason you're using [0:1] here instead of simply [0]?
> diff --git a/tests/test-terse-status.t b/tests/test-terse-status.t
> new file mode 100644
> --- /dev/null
> +++ b/tests/test-terse-status.t
> @@ -0,0 +1,106 @@
> + $ mkdir folder
> + $ cd folder
> + $ hg init
> + $ mkdir x
> + $ touch a b x/aa.o x/bb.o
> + $ hg status
> + ? a
> + ? b
> + ? x/aa.o
> + ? x/bb.o
> +
> +Show that only passed status are tersed
> + $ hg status --terse m
> + ? a
> + ? b
> + ? x/aa.o
> + ? x/bb.o
I think you need some tests that actually end up tersing a directory that
has only modified (or added, or ...) files.
Danek
More information about the Mercurial-devel
mailing list