D5453: test: introduce a new flag to display env variable line per line

lothiraldan (Boris Feld) phabricator at mercurial-scm.org
Thu Dec 20 13:04:03 EST 2018


lothiraldan added a comment.


  In https://phab.mercurial-scm.org/D5453#80871, @yuja wrote:
  
  > > +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`
  
  
  Will update for the Nits
  
  > 
  > 
  >> +    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.
  
  It's a bad resolution of a merge conflict, I will remote the line, nice catch

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