tests/test-username-newline.t
author Arseniy Alekseyev <aalekseyev@janestreet.com>
Thu, 16 Feb 2023 19:03:17 +0000
changeset 50164 8e50aa0db347
parent 49621 55c6ebd11cb9
permissions -rw-r--r--
rhg: in path_encode, use Vec directly instead of VecDest No need to have a trivial wrapper over the type. There's nothing confusing about vec.write_bytes(...), after all.

  $ hg init repo
  $ cd repo
  $ touch a

  $ unset HGUSER
  $ echo "[ui]" >> .hg/hgrc
  $ echo "username= foo" >> .hg/hgrc
  $ echo "          bar1" >> .hg/hgrc

  $ hg ci -Am m
  adding a
  abort: username 'foo\nbar1' contains a newline
  
  [255]
  $ rm .hg/hgrc

  $ HGUSER=`(echo foo; echo bar2)` hg ci -Am m
  adding a
  abort: username 'foo\nbar2' contains a newline
  
  [255]
  $ hg ci -Am m -u "`(echo foo; echo bar3)`"
  adding a
  transaction abort!
  rollback completed
  abort: username 'foo\nbar3' contains a newline
  [50]