tests/test-username-newline.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 30 Sep 2020 12:46:49 +0200
changeset 45660 e66db30f95a8
parent 33616 5ac845ca059a
child 45921 95c4cca641f6
permissions -rw-r--r--
salvaged: explicitly skip salvaged file while encoding This is a temporary measure to avoid diverging test cases (between commit time sidedata and upgraded sidedata) while we implement salvaged tracking in the different cases. This will be dropped soon. Differential Revision: https://phab.mercurial-scm.org/D9122

  $ hg init
  $ 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!
  [255]