tests/test-username-newline.t
author Martin von Zweigbergk <martinvonz@google.com>
Mon, 23 Mar 2015 23:04:51 -0700
changeset 24438 5b85a5bc5bbb
parent 12346 3b165c127690
child 33617 5ac845ca059a
permissions -rw-r--r--
revert: evaluate filesets against working directory (issue4497) As the failing revert tests in test-fileset-generated.t show, Revert currently creates one matcher for matching files in the working copy and another matcher for matching files in the target revision. The two matchers are created with different contexts, which means filesets are evaluated differently. Then the union of the sets of files matching the matchers in the two contexts are reverted. It doesn't seem to make sense to use two different matchers; only the context they're applied to should be different. It seems very likely that the user wants the filesets to be evaluated against the working directory, which the tests test-fileset-generated.t also assume, so let's make it so. I willingly admit that the largefiles code was modified by trial and error (according to tests).

  $ 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
  abort: username 'foo\nbar2' contains a newline
  
  [255]
  $ hg ci -Am m -u "`(echo foo; echo bar3)`"
  transaction abort!
  rollback completed
  abort: username 'foo\nbar3' contains a newline!
  [255]