D5453: test: introduce a new flag to display env variable line per line
yuja (Yuya Nishihara)
phabricator at mercurial-scm.org
Thu Dec 20 08:00:30 EST 2018
yuja added a comment.
> +parser.add_argument(
> + "--line",
> + action="store_const",
> + const=True,
> + default=False,
Nit: can be `action="store_true"`
> vars = [b"%s=%s" % (k.encode('ascii'), filter(v).encode('ascii'))
> for k, v in env]
>
> -out.write(b" ".join(vars))
> +
> +# Print variables on out
> +if args.line is False:
Nit: `not args.line`
> + vars = ["%s=%s" % (k, filter(v)) for k, v in env]
Why not reuse the `vars` constructed above? It's carefully written to be
Python3 safe.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5453
To: lothiraldan, #hg-reviewers
Cc: yuja, mercurial-devel
More information about the Mercurial-devel
mailing list