tests/test-username-newline.t
author Arseniy Alekseyev <aalekseyev@janestreet.com>
Thu, 11 Apr 2024 15:53:23 +0100
branchstable
changeset 51563 b861d913e7ec
parent 49621 55c6ebd11cb9
permissions -rw-r--r--
tests: add a test that demonstrates a bug in rhg status pattern handling The bug is in [visit_children_set], will be elaborated on in follow-up changes.

  $ 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]