##// END OF EJS Templates
tests: write hgrc of more than two lines by using shell heredoc...
Yuya Nishihara -
r23172:e955549c default
parent child Browse files
Show More
@@ -7,9 +7,11 b''
7 7 > EOF
8 8 $ abspath=`pwd`/abortcommit.py
9 9
10 $ echo "[extensions]" >> $HGRCPATH
11 $ echo "mq=" >> $HGRCPATH
12 $ echo "abortcommit = $abspath" >> $HGRCPATH
10 $ cat <<EOF >> $HGRCPATH
11 > [extensions]
12 > mq =
13 > abortcommit = $abspath
14 > EOF
13 15
14 16 $ hg init foo
15 17 $ cd foo
@@ -1,11 +1,13 b''
1 1 $ echo 'raise Exception("bit bucket overflow")' > badext.py
2 2 $ abspath=`pwd`/badext.py
3 3
4 $ echo '[extensions]' >> $HGRCPATH
5 $ echo "gpg =" >> $HGRCPATH
6 $ echo "hgext.gpg =" >> $HGRCPATH
7 $ echo "badext = $abspath" >> $HGRCPATH
8 $ echo "badext2 =" >> $HGRCPATH
4 $ cat <<EOF >> $HGRCPATH
5 > [extensions]
6 > gpg =
7 > hgext.gpg =
8 > badext = $abspath
9 > badext2 =
10 > EOF
9 11
10 12 $ hg -q help help
11 13 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
@@ -419,10 +419,12 b' branch b'
419 419
420 420 default branch colors:
421 421
422 $ echo "[extensions]" >> $HGRCPATH
423 $ echo "color =" >> $HGRCPATH
424 $ echo "[color]" >> $HGRCPATH
425 $ echo "mode = ansi" >> $HGRCPATH
422 $ cat <<EOF >> $HGRCPATH
423 > [extensions]
424 > color =
425 > [color]
426 > mode = ansi
427 > EOF
426 428
427 429 $ hg up -C c
428 430 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
@@ -444,14 +446,16 b' default closed branch color:'
444 446 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
445 447 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
446 448
447 $ echo "[extensions]" >> $HGRCPATH
448 $ echo "color =" >> $HGRCPATH
449 $ echo "[color]" >> $HGRCPATH
450 $ echo "branches.active = green" >> $HGRCPATH
451 $ echo "branches.closed = blue" >> $HGRCPATH
452 $ echo "branches.current = red" >> $HGRCPATH
453 $ echo "branches.inactive = magenta" >> $HGRCPATH
454 $ echo "log.changeset = cyan" >> $HGRCPATH
449 $ cat <<EOF >> $HGRCPATH
450 > [extensions]
451 > color =
452 > [color]
453 > branches.active = green
454 > branches.closed = blue
455 > branches.current = red
456 > branches.inactive = magenta
457 > log.changeset = cyan
458 > EOF
455 459
456 460 custom branch colors:
457 461
@@ -44,9 +44,11 b' Reset hgrc'
44 44
45 45 Test case sensitive configuration
46 46
47 $ echo '[Section]' >> $HGRCPATH
48 $ echo 'KeY = Case Sensitive' >> $HGRCPATH
49 $ echo 'key = lower case' >> $HGRCPATH
47 $ cat <<EOF >> $HGRCPATH
48 > [Section]
49 > KeY = Case Sensitive
50 > key = lower case
51 > EOF
50 52
51 53 $ hg showconfig Section
52 54 Section.KeY=Case Sensitive
@@ -1,8 +1,10 b''
1 1
2 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "convert = " >> $HGRCPATH
4 $ echo "[convert]" >> $HGRCPATH
5 $ echo "hg.tagsbranch=0" >> $HGRCPATH
2 $ cat <<EOF >> $HGRCPATH
3 > [extensions]
4 > convert =
5 > [convert]
6 > hg.tagsbranch = 0
7 > EOF
6 8 $ hg init source
7 9 $ cd source
8 10 $ echo a > a
@@ -7,10 +7,12 b' and http://mercurial.selenic.com/bts/iss'
7 7 > {
8 8 > cvs -f "$@" > /dev/null
9 9 > }
10 $ echo "[extensions]" >> $HGRCPATH
11 $ echo "convert = " >> $HGRCPATH
12 $ echo "[convert]" >> $HGRCPATH
13 $ echo "cvsps.cache=0" >> $HGRCPATH
10 $ cat <<EOF >> $HGRCPATH
11 > [extensions]
12 > convert =
13 > [convert]
14 > cvsps.cache = 0
15 > EOF
14 16
15 17 create cvs repository
16 18
@@ -23,11 +23,13 b' XXX copied from test-convert-cvs-synthet'
23 23
24 24 XXX copied from test-convert-cvs-synthetic
25 25
26 $ echo "[extensions]" >> $HGRCPATH
27 $ echo "convert = " >> $HGRCPATH
28 $ echo "[convert]" >> $HGRCPATH
29 $ echo "cvsps.cache=0" >> $HGRCPATH
30 $ echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH
26 $ cat <<EOF >> $HGRCPATH
27 > [extensions]
28 > convert =
29 > [convert]
30 > cvsps.cache = 0
31 > cvsps.mergefrom = \[MERGE from (\S+)\]
32 > EOF
31 33
32 34 create cvs repository with one project
33 35
@@ -18,9 +18,11 b''
18 18 > print "%s hook: %d changesets"%(hooktype,len(changesets))
19 19 > EOF
20 20 $ hookpath=`pwd`
21 $ echo "[hooks]" >> $HGRCPATH
22 $ echo "cvslog=python:$hookpath/cvshooks.py:cvslog" >> $HGRCPATH
23 $ echo "cvschangesets=python:$hookpath/cvshooks.py:cvschangesets" >> $HGRCPATH
21 $ cat <<EOF >> $HGRCPATH
22 > [hooks]
23 > cvslog = python:$hookpath/cvshooks.py:cvslog
24 > cvschangesets = python:$hookpath/cvshooks.py:cvschangesets
25 > EOF
24 26
25 27 create cvs repository
26 28
@@ -1,8 +1,10 b''
1 1 #require svn svn-bindings
2 2
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "convert = " >> $HGRCPATH
5 $ echo "mq = " >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
5 > convert =
6 > mq =
7 > EOF
6 8
7 9 $ SVNREPOPATH=`pwd`/svn-repo
8 10 #if windows
@@ -4,11 +4,13 b''
4 4 $ echo "autocrlf = false" >> $HOME/.gitconfig
5 5 $ echo "[core]" >> $HOME/.gitconfig
6 6 $ echo "autocrlf = false" >> $HOME/.gitconfig
7 $ echo "[extensions]" >> $HGRCPATH
8 $ echo "convert=" >> $HGRCPATH
9 $ echo '[convert]' >> $HGRCPATH
10 $ echo 'hg.usebranchnames = True' >> $HGRCPATH
11 $ echo 'hg.tagsbranch = tags-update' >> $HGRCPATH
7 $ cat <<EOF >> $HGRCPATH
8 > [extensions]
9 > convert =
10 > [convert]
11 > hg.usebranchnames = True
12 > hg.tagsbranch = tags-update
13 > EOF
12 14 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
13 15 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
14 16 $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
@@ -1,9 +1,11 b''
1 1 Setup
2 2
3 $ echo "[color]" >> $HGRCPATH
4 $ echo "mode = ansi" >> $HGRCPATH
5 $ echo "[extensions]" >> $HGRCPATH
6 $ echo "color=" >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [color]
5 > mode = ansi
6 > [extensions]
7 > color =
8 > EOF
7 9 $ hg init repo
8 10 $ cd repo
9 11 $ cat > a <<EOF
@@ -66,11 +68,13 b' diffstat'
66 68 $ hg diff --stat --color=always
67 69 a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
68 70 1 files changed, 1 insertions(+), 1 deletions(-)
69 $ echo "record=" >> $HGRCPATH
70 $ echo "[ui]" >> $HGRCPATH
71 $ echo "interactive=true" >> $HGRCPATH
72 $ echo "[diff]" >> $HGRCPATH
73 $ echo "git=True" >> $HGRCPATH
71 $ cat <<EOF >> $HGRCPATH
72 > record =
73 > [ui]
74 > interactive = true
75 > [diff]
76 > git = True
77 > EOF
74 78
75 79 #if execbit
76 80
@@ -1,9 +1,11 b''
1 1 #require execbit
2 2
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH
5 $ echo "[diff]" >> $HGRCPATH
6 $ echo "nodates=1" >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
5 > autodiff = $TESTDIR/autodiff.py
6 > [diff]
7 > nodates = 1
8 > EOF
7 9
8 10 $ hg init repo
9 11 $ cd repo
@@ -408,10 +408,12 b' Test issue2569 -- eol extension takes wr'
408 408
409 409 Test cleverencode: and cleverdecode: aliases for win32text extension
410 410
411 $ echo '[encode]' >> $HGRCPATH
412 $ echo '**.txt = cleverencode:' >> $HGRCPATH
413 $ echo '[decode]' >> $HGRCPATH
414 $ echo '**.txt = cleverdecode:' >> $HGRCPATH
411 $ cat <<EOF >> $HGRCPATH
412 > [encode]
413 > **.txt = cleverencode:
414 > [decode]
415 > **.txt = cleverdecode:
416 > EOF
415 417
416 418 $ hg init win32compat
417 419 $ cd win32compat
@@ -59,10 +59,12 b' test issue2039'
59 59
60 60 $ hg init bar
61 61 $ cd bar
62 $ echo "[extensions]" >> $HGRCPATH
63 $ echo "color=" >> $HGRCPATH
64 $ echo "[color]" >> $HGRCPATH
65 $ echo "mode = ansi" >> $HGRCPATH
62 $ cat <<EOF >> $HGRCPATH
63 > [extensions]
64 > color =
65 > [color]
66 > mode = ansi
67 > EOF
66 68 $ A=`printf 'foo\nbar'`
67 69 $ B=`printf 'foo\nbar.baz'`
68 70 $ touch "$A"
@@ -176,10 +176,12 b' Catch exporting unknown revisions (espec'
176 176 [255]
177 177
178 178 Check for color output
179 $ echo "[color]" >> $HGRCPATH
180 $ echo "mode = ansi" >> $HGRCPATH
181 $ echo "[extensions]" >> $HGRCPATH
182 $ echo "color=" >> $HGRCPATH
179 $ cat <<EOF >> $HGRCPATH
180 > [color]
181 > mode = ansi
182 > [extensions]
183 > color =
184 > EOF
183 185
184 186 $ hg export --color always --nodates tip
185 187 # HG changeset patch
@@ -16,11 +16,13 b' Should diff cloned directories:'
16 16 Only in a: b
17 17 [1]
18 18
19 $ echo "[extdiff]" >> $HGRCPATH
20 $ echo "cmd.falabala=echo" >> $HGRCPATH
21 $ echo "opts.falabala=diffing" >> $HGRCPATH
22 $ echo "cmd.edspace=echo" >> $HGRCPATH
23 $ echo 'opts.edspace="name <user@example.com>"' >> $HGRCPATH
19 $ cat <<EOF >> $HGRCPATH
20 > [extdiff]
21 > cmd.falabala = echo
22 > opts.falabala = diffing
23 > cmd.edspace = echo
24 > opts.edspace = "name <user@example.com>"
25 > EOF
24 26
25 27 $ hg falabala
26 28 diffing a.000000000000 a
@@ -557,11 +557,13 b' Issue811: Problem loading extensions twi'
557 557 > "yet another debug command"
558 558 > ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
559 559 > EOF
560 $ echo "debugissue811 = $debugpath" >> $HGRCPATH
561 $ echo "mq=" >> $HGRCPATH
562 $ echo "strip=" >> $HGRCPATH
563 $ echo "hgext.mq=" >> $HGRCPATH
564 $ echo "hgext/mq=" >> $HGRCPATH
560 $ cat <<EOF >> $HGRCPATH
561 > debugissue811 = $debugpath
562 > mq =
563 > strip =
564 > hgext.mq =
565 > hgext/mq =
566 > EOF
565 567
566 568 Show extensions:
567 569 (note that mq force load strip, also checking it's not loaded twice)
@@ -812,9 +814,11 b' Commands handling multiple repositories '
812 814 $ hg -q -R pull-src1 pull src
813 815 reposetup() for $TESTTMP/reposetup-test/src (glob)
814 816
815 $ echo '[extensions]' >> $HGRCPATH
816 $ echo '# disable extension globally and explicitly' >> $HGRCPATH
817 $ echo 'reposetuptest = !' >> $HGRCPATH
817 $ cat <<EOF >> $HGRCPATH
818 > [extensions]
819 > # disable extension globally and explicitly
820 > reposetuptest = !
821 > EOF
818 822 $ hg clone -U src clone-dst2
819 823 reposetup() for $TESTTMP/reposetup-test/src (glob)
820 824 $ hg init push-dst2
@@ -824,9 +828,11 b' Commands handling multiple repositories '
824 828 $ hg -q -R pull-src2 pull src
825 829 reposetup() for $TESTTMP/reposetup-test/src (glob)
826 830
827 $ echo '[extensions]' >> $HGRCPATH
828 $ echo '# enable extension globally' >> $HGRCPATH
829 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> $HGRCPATH
831 $ cat <<EOF >> $HGRCPATH
832 > [extensions]
833 > # enable extension globally
834 > reposetuptest = $TESTTMP/reposetuptest.py
835 > EOF
830 836 $ hg clone -U src clone-dst3
831 837 reposetup() for $TESTTMP/reposetup-test/src (glob)
832 838 reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob)
@@ -862,9 +868,11 b' disabling in command line overlays with '
862 868 $ hg --config extensions.reposetuptest=! init pull-src5
863 869 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
864 870
865 $ echo '[extensions]' >> $HGRCPATH
866 $ echo '# disable extension globally and explicitly' >> $HGRCPATH
867 $ echo 'reposetuptest = !' >> $HGRCPATH
871 $ cat <<EOF >> $HGRCPATH
872 > [extensions]
873 > # disable extension globally and explicitly
874 > reposetuptest = !
875 > EOF
868 876 $ hg init parent
869 877 $ hg init parent/sub1
870 878 $ echo 1 > parent/sub1/1
@@ -2,10 +2,12 b''
2 2 Test interactions between mq and patch.eol
3 3
4 4
5 $ echo "[extensions]" >> $HGRCPATH
6 $ echo "mq=" >> $HGRCPATH
7 $ echo "[diff]" >> $HGRCPATH
8 $ echo "nodates=1" >> $HGRCPATH
5 $ cat <<EOF >> $HGRCPATH
6 > [extensions]
7 > mq =
8 > [diff]
9 > nodates = 1
10 > EOF
9 11
10 12 $ cat > makepatch.py <<EOF
11 13 > f = file('eol.diff', 'wb')
@@ -1,10 +1,12 b''
1 1 # Test the plumbing of mq.git option
2 2 # Automatic upgrade itself is tested elsewhere.
3 3
4 $ echo "[extensions]" >> $HGRCPATH
5 $ echo "mq=" >> $HGRCPATH
6 $ echo "[diff]" >> $HGRCPATH
7 $ echo "nodates=1" >> $HGRCPATH
4 $ cat <<EOF >> $HGRCPATH
5 > [extensions]
6 > mq =
7 > [diff]
8 > nodates = 1
9 > EOF
8 10
9 11 $ hg init repo-auto
10 12 $ cd repo-auto
@@ -1,8 +1,10 b''
1 1
2 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "mq=" >> $HGRCPATH
4 $ echo "[diff]" >> $HGRCPATH
5 $ echo "nodates=true" >> $HGRCPATH
2 $ cat <<EOF >> $HGRCPATH
3 > [extensions]
4 > mq =
5 > [diff]
6 > nodates = true
7 > EOF
6 8 $ catpatch() {
7 9 > cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
8 10 > -e "s/^\(# Parent \).*/\1/"
@@ -1,9 +1,11 b''
1 1 Setup extension:
2 2
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "mq =" >> $HGRCPATH
5 $ echo "[mq]" >> $HGRCPATH
6 $ echo "git = keep" >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
5 > mq =
6 > [mq]
7 > git = keep
8 > EOF
7 9
8 10 Test merge with mq changeset as the second parent:
9 11
@@ -1,7 +1,9 b''
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
3 $ echo "[mq]" >> $HGRCPATH
4 $ echo "git=keep" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
3 > mq =
4 > [mq]
5 > git = keep
6 > EOF
5 7
6 8 $ hg init a
7 9 $ cd a
@@ -1,9 +1,11 b''
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
3 $ echo "[mq]" >> $HGRCPATH
4 $ echo "git=keep" >> $HGRCPATH
5 $ echo "[diff]" >> $HGRCPATH
6 $ echo "nodates=1" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
3 > mq =
4 > [mq]
5 > git = keep
6 > [diff]
7 > nodates = 1
8 > EOF
7 9
8 10 init:
9 11
@@ -15,10 +15,12 b''
15 15 > f.close()
16 16 >
17 17 > EOF
18 $ echo "[extensions]" >> $HGRCPATH
19 $ echo "mq=" >> $HGRCPATH
20 $ echo "[diff]" >> $HGRCPATH
21 $ echo "git=1" >> $HGRCPATH
18 > cat <<EOF >> $HGRCPATH
19 > [extensions]
20 > mq =
21 > [diff]
22 > git = 1
23 > EOF
22 24 $ hg init repo
23 25 $ cd repo
24 26
@@ -1,7 +1,9 b''
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
3 $ echo "[diff]" >> $HGRCPATH
4 $ echo "nodates=1" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
3 > mq =
4 > [diff]
5 > nodates = 1
6 > EOF
5 7
6 8 $ hg init a
7 9 $ cd a
@@ -1,9 +1,11 b''
1 1 #require svn13
2 2
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "mq=" >> $HGRCPATH
5 $ echo "[diff]" >> $HGRCPATH
6 $ echo "nodates=1" >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
5 > mq =
6 > [diff]
7 > nodates = 1
8 > EOF
7 9
8 10 fn to create new repository, and cd into it
9 11 $ mkrepo() {
@@ -1,10 +1,12 b''
1 $ echo "[ui]" >> $HGRCPATH
2 $ echo "commitsubrepos = Yes" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "mq=" >> $HGRCPATH
5 $ echo "record=" >> $HGRCPATH
6 $ echo "[diff]" >> $HGRCPATH
7 $ echo "nodates=1" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [ui]
3 > commitsubrepos = Yes
4 > [extensions]
5 > mq =
6 > record =
7 > [diff]
8 > nodates = 1
9 > EOF
8 10
9 11 $ stdin=`pwd`/stdin.tmp
10 12
@@ -5,11 +5,12 b''
5 5 > fi
6 6 > }
7 7
8 $ echo "[extensions]" >> $HGRCPATH
9 $ echo "mq=" >> $HGRCPATH
10
11 $ echo "[mq]" >> $HGRCPATH
12 $ echo "plain=true" >> $HGRCPATH
8 $ cat <<EOF >> $HGRCPATH
9 > [extensions]
10 > mq =
11 > [mq]
12 > plain = true
13 > EOF
13 14
14 15
15 16 help
@@ -1,9 +1,11 b''
1 1 Set up a repo
2 2
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "interactive=true" >> $HGRCPATH
5 $ echo "[extensions]" >> $HGRCPATH
6 $ echo "record=" >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [ui]
5 > interactive = true
6 > [extensions]
7 > record =
8 > EOF
7 9
8 10 $ hg init a
9 11 $ cd a
@@ -1,9 +1,11 b''
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
3 $ echo "shelve=" >> $HGRCPATH
4 $ echo "[defaults]" >> $HGRCPATH
5 $ echo "diff = --nodates --git" >> $HGRCPATH
6 $ echo "qnew = --date '0 0'" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
3 > mq =
4 > shelve =
5 > [defaults]
6 > diff = --nodates --git
7 > qnew = --date '0 0'
8 > EOF
7 9
8 10 $ hg init repo
9 11 $ cd repo
@@ -1,7 +1,9 b''
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "color=" >> $HGRCPATH
3 $ echo "[color]" >> $HGRCPATH
4 $ echo "mode=ansi" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
3 > color =
4 > [color]
5 > mode = ansi
6 > EOF
5 7 Terminfo codes compatibility fix
6 8 $ echo "color.none=0" >> $HGRCPATH
7 9
General Comments 0
You need to be logged in to leave comments. Login now