tests/test-committer.t
author Mads Kiilerich <mads@kiilerich.com>
Mon, 11 Jun 2012 01:40:51 +0200
changeset 16913 f2719b387380
parent 12375 02990e22150b
child 16940 6409a5c75125
permissions -rw-r--r--
tests: add missing trailing 'cd ..' Many tests didn't change back from subdirectories at the end of the tests ... and they don't have to. The missing 'cd ..' could always be added when another test case is added to the test file. This change do that tests (99.5%) consistently end up in $TESTDIR where they started, thus making it simpler to extend them or move them around.

  $ unset HGUSER
  $ EMAIL="My Name <myname@example.com>"
  $ export EMAIL

  $ hg init test
  $ cd test
  $ touch asdf
  $ hg add asdf
  $ hg commit -m commit-1
  $ hg tip
  changeset:   0:53f268a58230
  tag:         tip
  user:        My Name <myname@example.com>
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     commit-1
  

  $ unset EMAIL
  $ echo 1234 > asdf
  $ hg commit -u "foo@bar.com" -m commit-1
  $ hg tip
  changeset:   1:3871b2a9e9bf
  tag:         tip
  user:        foo@bar.com
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     commit-1
  
  $ echo "[ui]" >> .hg/hgrc
  $ echo "username = foobar <foo@bar.com>" >> .hg/hgrc
  $ echo 12 > asdf
  $ hg commit -m commit-1
  $ hg tip
  changeset:   2:8eeac6695c1c
  tag:         tip
  user:        foobar <foo@bar.com>
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     commit-1
  
  $ echo 1 > asdf
  $ hg commit -u "foo@bar.com" -m commit-1
  $ hg tip
  changeset:   3:957606a725e4
  tag:         tip
  user:        foo@bar.com
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     commit-1
  
  $ echo 123 > asdf
  $ echo "[ui]" > .hg/hgrc
  $ echo "username = " >> .hg/hgrc
  $ hg commit -m commit-1
  abort: no username supplied (see "hg help config")
  [255]
  $ rm .hg/hgrc
  $ hg commit -m commit-1 2>&1
  No username found, using '[^']*' instead (re)

  $ echo space > asdf
  $ hg commit -u ' ' -m commit-1
  transaction abort!
  rollback completed
  abort: empty username!
  [255]

  $ cd ..