sapling/tests/test-committer.t
Brodie Rao 7d7d96bd74 tests: require regexes in unified tests to be marked with " (re)"
Consider this test:

  $ hg glog --template '{rev}:{node|short} "{desc}"\n'
  @  2:20c4f79fd7ac "3"
  |
  | o  1:38f24201dcab "2"
  |/
  o  0:2a18120dc1c9 "1"

Because each line beginning with "|" can be compiled as a regular
expression (equivalent to ".*|"), they will match any output.

Similarly:

  $ echo foo


The blank output line can be compiled as a regular expression and will
also match any output.

With this patch, none of the above output lines will be matched as
regular expressions. A line must end in " (re)" in order to be matched
as one.

Lines are still matched literally first, so the following will pass:

  $ echo 'foo (re)'
  foo (re)
2010-09-22 16:06:00 -05:00

64 lines
1.5 KiB
Perl

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