[PATCH V2] tests: write hgrc of more than two lines by using shell heredoc

Augie Fackler raf at durin42.com
Tue Nov 4 11:33:13 CST 2014


On Wed, Nov 05, 2014 at 12:18:47AM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1415112106 -32400
> #      Tue Nov 04 23:41:46 2014 +0900
> # Node ID 3284877169033e48d8550dd19bbe2c95f4ae92a8
> # Parent  30e0dcd7c5ffd99fb9c2474e9d73ca01a7d292fa
> tests: write hgrc of more than two lines by using shell heredoc
>

queued, thanks

>
> Here document should be readable than repeating echo commands.
>
> diff --git a/tests/test-abort-checkin.t b/tests/test-abort-checkin.t
> --- a/tests/test-abort-checkin.t
> +++ b/tests/test-abort-checkin.t
> @@ -7,9 +7,11 @@
>    > EOF
>    $ abspath=`pwd`/abortcommit.py
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "abortcommit = $abspath" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > abortcommit = $abspath
> +  > EOF
>
>    $ hg init foo
>    $ cd foo
> diff --git a/tests/test-bad-extension.t b/tests/test-bad-extension.t
> --- a/tests/test-bad-extension.t
> +++ b/tests/test-bad-extension.t
> @@ -1,11 +1,13 @@
>    $ echo 'raise Exception("bit bucket overflow")' > badext.py
>    $ abspath=`pwd`/badext.py
>
> -  $ echo '[extensions]' >> $HGRCPATH
> -  $ echo "gpg =" >> $HGRCPATH
> -  $ echo "hgext.gpg =" >> $HGRCPATH
> -  $ echo "badext = $abspath" >> $HGRCPATH
> -  $ echo "badext2 =" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > gpg =
> +  > hgext.gpg =
> +  > badext = $abspath
> +  > badext2 =
> +  > EOF
>
>    $ hg -q help help
>    *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
> diff --git a/tests/test-branches.t b/tests/test-branches.t
> --- a/tests/test-branches.t
> +++ b/tests/test-branches.t
> @@ -419,10 +419,12 @@ branch b
>
>  default branch colors:
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "color =" >> $HGRCPATH
> -  $ echo "[color]" >> $HGRCPATH
> -  $ echo "mode = ansi" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > color =
> +  > [color]
> +  > mode = ansi
> +  > EOF
>
>    $ hg up -C c
>    3 files updated, 0 files merged, 2 files removed, 0 files unresolved
> @@ -444,14 +446,16 @@ default closed branch color:
>    \x1b[0;0ma\x1b[0m\x1b[0;33m                              5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
>    \x1b[0;0mdefault\x1b[0m\x1b[0;33m                        0:19709c5a4e75\x1b[0m (inactive) (esc)
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "color =" >> $HGRCPATH
> -  $ echo "[color]" >> $HGRCPATH
> -  $ echo "branches.active = green" >> $HGRCPATH
> -  $ echo "branches.closed = blue" >> $HGRCPATH
> -  $ echo "branches.current = red" >> $HGRCPATH
> -  $ echo "branches.inactive = magenta" >> $HGRCPATH
> -  $ echo "log.changeset = cyan" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > color =
> +  > [color]
> +  > branches.active = green
> +  > branches.closed = blue
> +  > branches.current = red
> +  > branches.inactive = magenta
> +  > log.changeset = cyan
> +  > EOF
>
>  custom branch colors:
>
> diff --git a/tests/test-config.t b/tests/test-config.t
> --- a/tests/test-config.t
> +++ b/tests/test-config.t
> @@ -44,9 +44,11 @@ Reset hgrc
>
>  Test case sensitive configuration
>
> -  $ echo '[Section]' >> $HGRCPATH
> -  $ echo 'KeY = Case Sensitive' >> $HGRCPATH
> -  $ echo 'key = lower case' >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [Section]
> +  > KeY = Case Sensitive
> +  > key = lower case
> +  > EOF
>
>    $ hg showconfig Section
>    Section.KeY=Case Sensitive
> diff --git a/tests/test-convert-clonebranches.t b/tests/test-convert-clonebranches.t
> --- a/tests/test-convert-clonebranches.t
> +++ b/tests/test-convert-clonebranches.t
> @@ -1,8 +1,10 @@
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "convert = " >> $HGRCPATH
> -  $ echo "[convert]" >> $HGRCPATH
> -  $ echo "hg.tagsbranch=0" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > convert =
> +  > [convert]
> +  > hg.tagsbranch = 0
> +  > EOF
>    $ hg init source
>    $ cd source
>    $ echo a > a
> diff --git a/tests/test-convert-cvs-branch.t b/tests/test-convert-cvs-branch.t
> --- a/tests/test-convert-cvs-branch.t
> +++ b/tests/test-convert-cvs-branch.t
> @@ -7,10 +7,12 @@ and http://mercurial.selenic.com/bts/iss
>    > {
>    >     cvs -f "$@" > /dev/null
>    > }
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "convert = " >> $HGRCPATH
> -  $ echo "[convert]" >> $HGRCPATH
> -  $ echo "cvsps.cache=0" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > convert =
> +  > [convert]
> +  > cvsps.cache = 0
> +  > EOF
>
>  create cvs repository
>
> diff --git a/tests/test-convert-cvs-detectmerge.t b/tests/test-convert-cvs-detectmerge.t
> --- a/tests/test-convert-cvs-detectmerge.t
> +++ b/tests/test-convert-cvs-detectmerge.t
> @@ -23,11 +23,13 @@ XXX copied from test-convert-cvs-synthet
>
>  XXX copied from test-convert-cvs-synthetic
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "convert = " >> $HGRCPATH
> -  $ echo "[convert]" >> $HGRCPATH
> -  $ echo "cvsps.cache=0" >> $HGRCPATH
> -  $ echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > convert =
> +  > [convert]
> +  > cvsps.cache = 0
> +  > cvsps.mergefrom = \[MERGE from (\S+)\]
> +  > EOF
>
>  create cvs repository with one project
>
> diff --git a/tests/test-convert-cvs.t b/tests/test-convert-cvs.t
> --- a/tests/test-convert-cvs.t
> +++ b/tests/test-convert-cvs.t
> @@ -18,9 +18,11 @@
>    >     print "%s hook: %d changesets"%(hooktype,len(changesets))
>    > EOF
>    $ hookpath=`pwd`
> -  $ echo "[hooks]" >> $HGRCPATH
> -  $ echo "cvslog=python:$hookpath/cvshooks.py:cvslog" >> $HGRCPATH
> -  $ echo "cvschangesets=python:$hookpath/cvshooks.py:cvschangesets" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [hooks]
> +  > cvslog = python:$hookpath/cvshooks.py:cvslog
> +  > cvschangesets = python:$hookpath/cvshooks.py:cvschangesets
> +  > EOF
>
>  create cvs repository
>
> diff --git a/tests/test-convert-hg-svn.t b/tests/test-convert-hg-svn.t
> --- a/tests/test-convert-hg-svn.t
> +++ b/tests/test-convert-hg-svn.t
> @@ -1,8 +1,10 @@
>  #require svn svn-bindings
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "convert = " >> $HGRCPATH
> -  $ echo "mq = " >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > convert =
> +  > mq =
> +  > EOF
>
>    $ SVNREPOPATH=`pwd`/svn-repo
>  #if windows
> diff --git a/tests/test-convert-tagsbranch-topology.t b/tests/test-convert-tagsbranch-topology.t
> --- a/tests/test-convert-tagsbranch-topology.t
> +++ b/tests/test-convert-tagsbranch-topology.t
> @@ -4,11 +4,13 @@
>    $ echo "autocrlf = false" >> $HOME/.gitconfig
>    $ echo "[core]" >> $HOME/.gitconfig
>    $ echo "autocrlf = false" >> $HOME/.gitconfig
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "convert=" >> $HGRCPATH
> -  $ echo '[convert]' >> $HGRCPATH
> -  $ echo 'hg.usebranchnames = True' >> $HGRCPATH
> -  $ echo 'hg.tagsbranch = tags-update' >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > convert =
> +  > [convert]
> +  > hg.usebranchnames = True
> +  > hg.tagsbranch = tags-update
> +  > EOF
>    $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
>    $ GIT_AUTHOR_EMAIL='test at example.org'; export GIT_AUTHOR_EMAIL
>    $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
> diff --git a/tests/test-diff-color.t b/tests/test-diff-color.t
> --- a/tests/test-diff-color.t
> +++ b/tests/test-diff-color.t
> @@ -1,9 +1,11 @@
>  Setup
>
> -  $ echo "[color]" >> $HGRCPATH
> -  $ echo "mode = ansi" >> $HGRCPATH
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "color=" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [color]
> +  > mode = ansi
> +  > [extensions]
> +  > color =
> +  > EOF
>    $ hg init repo
>    $ cd repo
>    $ cat > a <<EOF
> @@ -66,11 +68,13 @@ diffstat
>    $ hg diff --stat --color=always
>     a |  2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
>     1 files changed, 1 insertions(+), 1 deletions(-)
> -  $ echo "record=" >> $HGRCPATH
> -  $ echo "[ui]" >> $HGRCPATH
> -  $ echo "interactive=true" >> $HGRCPATH
> -  $ echo "[diff]" >> $HGRCPATH
> -  $ echo "git=True" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > record =
> +  > [ui]
> +  > interactive = true
> +  > [diff]
> +  > git = True
> +  > EOF
>
>  #if execbit
>
> diff --git a/tests/test-diff-upgrade.t b/tests/test-diff-upgrade.t
> --- a/tests/test-diff-upgrade.t
> +++ b/tests/test-diff-upgrade.t
> @@ -1,9 +1,11 @@
>  #require execbit
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH
> -  $ echo "[diff]" >> $HGRCPATH
> -  $ echo "nodates=1" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > autodiff = $TESTDIR/autodiff.py
> +  > [diff]
> +  > nodates = 1
> +  > EOF
>
>    $ hg init repo
>    $ cd repo
> diff --git a/tests/test-eol.t b/tests/test-eol.t
> --- a/tests/test-eol.t
> +++ b/tests/test-eol.t
> @@ -408,10 +408,12 @@ Test issue2569 -- eol extension takes wr
>
>  Test cleverencode: and cleverdecode: aliases for win32text extension
>
> -  $ echo '[encode]' >> $HGRCPATH
> -  $ echo '**.txt = cleverencode:' >> $HGRCPATH
> -  $ echo '[decode]' >> $HGRCPATH
> -  $ echo '**.txt = cleverdecode:' >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [encode]
> +  > **.txt = cleverencode:
> +  > [decode]
> +  > **.txt = cleverdecode:
> +  > EOF
>
>    $ hg init win32compat
>    $ cd win32compat
> diff --git a/tests/test-eolfilename.t b/tests/test-eolfilename.t
> --- a/tests/test-eolfilename.t
> +++ b/tests/test-eolfilename.t
> @@ -59,10 +59,12 @@ test issue2039
>
>    $ hg init bar
>    $ cd bar
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "color=" >> $HGRCPATH
> -  $ echo "[color]" >> $HGRCPATH
> -  $ echo "mode = ansi" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > color =
> +  > [color]
> +  > mode = ansi
> +  > EOF
>    $ A=`printf 'foo\nbar'`
>    $ B=`printf 'foo\nbar.baz'`
>    $ touch "$A"
> diff --git a/tests/test-export.t b/tests/test-export.t
> --- a/tests/test-export.t
> +++ b/tests/test-export.t
> @@ -176,10 +176,12 @@ Catch exporting unknown revisions (espec
>    [255]
>
>  Check for color output
> -  $ echo "[color]" >> $HGRCPATH
> -  $ echo "mode = ansi" >> $HGRCPATH
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "color=" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [color]
> +  > mode = ansi
> +  > [extensions]
> +  > color =
> +  > EOF
>
>    $ hg export --color always --nodates tip
>    # HG changeset patch
> diff --git a/tests/test-extdiff.t b/tests/test-extdiff.t
> --- a/tests/test-extdiff.t
> +++ b/tests/test-extdiff.t
> @@ -16,11 +16,13 @@ Should diff cloned directories:
>    Only in a: b
>    [1]
>
> -  $ echo "[extdiff]" >> $HGRCPATH
> -  $ echo "cmd.falabala=echo" >> $HGRCPATH
> -  $ echo "opts.falabala=diffing" >> $HGRCPATH
> -  $ echo "cmd.edspace=echo" >> $HGRCPATH
> -  $ echo 'opts.edspace="name  <user at example.com>"' >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extdiff]
> +  > cmd.falabala = echo
> +  > opts.falabala = diffing
> +  > cmd.edspace = echo
> +  > opts.edspace = "name  <user at example.com>"
> +  > EOF
>
>    $ hg falabala
>    diffing a.000000000000 a
> diff --git a/tests/test-extension.t b/tests/test-extension.t
> --- a/tests/test-extension.t
> +++ b/tests/test-extension.t
> @@ -557,11 +557,13 @@ Issue811: Problem loading extensions twi
>    >     "yet another debug command"
>    >     ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
>    > EOF
> -  $ echo "debugissue811 = $debugpath" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "strip=" >> $HGRCPATH
> -  $ echo "hgext.mq=" >> $HGRCPATH
> -  $ echo "hgext/mq=" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > debugissue811 = $debugpath
> +  > mq =
> +  > strip =
> +  > hgext.mq =
> +  > hgext/mq =
> +  > EOF
>
>  Show extensions:
>  (note that mq force load strip, also checking it's not loaded twice)
> @@ -812,9 +814,11 @@ Commands handling multiple repositories
>    $ hg -q -R pull-src1 pull src
>    reposetup() for $TESTTMP/reposetup-test/src (glob)
>
> -  $ echo '[extensions]' >> $HGRCPATH
> -  $ echo '# disable extension globally and explicitly' >> $HGRCPATH
> -  $ echo 'reposetuptest = !' >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > # disable extension globally and explicitly
> +  > reposetuptest = !
> +  > EOF
>    $ hg clone -U src clone-dst2
>    reposetup() for $TESTTMP/reposetup-test/src (glob)
>    $ hg init push-dst2
> @@ -824,9 +828,11 @@ Commands handling multiple repositories
>    $ hg -q -R pull-src2 pull src
>    reposetup() for $TESTTMP/reposetup-test/src (glob)
>
> -  $ echo '[extensions]' >> $HGRCPATH
> -  $ echo '# enable extension globally' >> $HGRCPATH
> -  $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > # enable extension globally
> +  > reposetuptest = $TESTTMP/reposetuptest.py
> +  > EOF
>    $ hg clone -U src clone-dst3
>    reposetup() for $TESTTMP/reposetup-test/src (glob)
>    reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob)
> @@ -862,9 +868,11 @@ disabling in command line overlays with
>    $ hg --config extensions.reposetuptest=! init pull-src5
>    $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
>
> -  $ echo '[extensions]' >> $HGRCPATH
> -  $ echo '# disable extension globally and explicitly' >> $HGRCPATH
> -  $ echo 'reposetuptest = !' >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > # disable extension globally and explicitly
> +  > reposetuptest = !
> +  > EOF
>    $ hg init parent
>    $ hg init parent/sub1
>    $ echo 1 > parent/sub1/1
> diff --git a/tests/test-mq-eol.t b/tests/test-mq-eol.t
> --- a/tests/test-mq-eol.t
> +++ b/tests/test-mq-eol.t
> @@ -2,10 +2,12 @@
>  Test interactions between mq and patch.eol
>
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "[diff]" >> $HGRCPATH
> -  $ echo "nodates=1" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > [diff]
> +  > nodates = 1
> +  > EOF
>
>    $ cat > makepatch.py <<EOF
>    > f = file('eol.diff', 'wb')
> diff --git a/tests/test-mq-git.t b/tests/test-mq-git.t
> --- a/tests/test-mq-git.t
> +++ b/tests/test-mq-git.t
> @@ -1,10 +1,12 @@
>  # Test the plumbing of mq.git option
>  # Automatic upgrade itself is tested elsewhere.
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "[diff]" >> $HGRCPATH
> -  $ echo "nodates=1" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > [diff]
> +  > nodates = 1
> +  > EOF
>
>    $ hg init repo-auto
>    $ cd repo-auto
> diff --git a/tests/test-mq-header-date.t b/tests/test-mq-header-date.t
> --- a/tests/test-mq-header-date.t
> +++ b/tests/test-mq-header-date.t
> @@ -1,8 +1,10 @@
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "[diff]" >> $HGRCPATH
> -  $ echo "nodates=true" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > [diff]
> +  > nodates = true
> +  > EOF
>    $ catpatch() {
>    >     cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
>    >                                    -e "s/^\(# Parent \).*/\1/"
> diff --git a/tests/test-mq-merge.t b/tests/test-mq-merge.t
> --- a/tests/test-mq-merge.t
> +++ b/tests/test-mq-merge.t
> @@ -1,9 +1,11 @@
>  Setup extension:
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq =" >> $HGRCPATH
> -  $ echo "[mq]" >> $HGRCPATH
> -  $ echo "git = keep" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > [mq]
> +  > git = keep
> +  > EOF
>
>  Test merge with mq changeset as the second parent:
>
> diff --git a/tests/test-mq-qdiff.t b/tests/test-mq-qdiff.t
> --- a/tests/test-mq-qdiff.t
> +++ b/tests/test-mq-qdiff.t
> @@ -1,7 +1,9 @@
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "[mq]" >> $HGRCPATH
> -  $ echo "git=keep" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > [mq]
> +  > git = keep
> +  > EOF
>
>    $ hg init a
>    $ cd a
> diff --git a/tests/test-mq-qfold.t b/tests/test-mq-qfold.t
> --- a/tests/test-mq-qfold.t
> +++ b/tests/test-mq-qfold.t
> @@ -1,9 +1,11 @@
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "[mq]" >> $HGRCPATH
> -  $ echo "git=keep" >> $HGRCPATH
> -  $ echo "[diff]" >> $HGRCPATH
> -  $ echo "nodates=1" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > [mq]
> +  > git = keep
> +  > [diff]
> +  > nodates = 1
> +  > EOF
>
>  init:
>
> diff --git a/tests/test-mq-qimport.t b/tests/test-mq-qimport.t
> --- a/tests/test-mq-qimport.t
> +++ b/tests/test-mq-qimport.t
> @@ -15,10 +15,12 @@
>    > f.close()
>    >
>    > EOF
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "[diff]" >> $HGRCPATH
> -  $ echo "git=1" >> $HGRCPATH
> +  > cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > [diff]
> +  > git = 1
> +  > EOF
>    $ hg init repo
>    $ cd repo
>
> diff --git a/tests/test-mq-qrefresh.t b/tests/test-mq-qrefresh.t
> --- a/tests/test-mq-qrefresh.t
> +++ b/tests/test-mq-qrefresh.t
> @@ -1,7 +1,9 @@
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "[diff]" >> $HGRCPATH
> -  $ echo "nodates=1" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > [diff]
> +  > nodates = 1
> +  > EOF
>
>    $ hg init a
>    $ cd a
> diff --git a/tests/test-mq-subrepo-svn.t b/tests/test-mq-subrepo-svn.t
> --- a/tests/test-mq-subrepo-svn.t
> +++ b/tests/test-mq-subrepo-svn.t
> @@ -1,9 +1,11 @@
>  #require svn13
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "[diff]" >> $HGRCPATH
> -  $ echo "nodates=1" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > [diff]
> +  > nodates = 1
> +  > EOF
>
>  fn to create new repository, and cd into it
>    $ mkrepo() {
> diff --git a/tests/test-mq-subrepo.t b/tests/test-mq-subrepo.t
> --- a/tests/test-mq-subrepo.t
> +++ b/tests/test-mq-subrepo.t
> @@ -1,10 +1,12 @@
> -  $ echo "[ui]" >> $HGRCPATH
> -  $ echo "commitsubrepos = Yes" >> $HGRCPATH
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "record=" >> $HGRCPATH
> -  $ echo "[diff]" >> $HGRCPATH
> -  $ echo "nodates=1" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [ui]
> +  > commitsubrepos = Yes
> +  > [extensions]
> +  > mq =
> +  > record =
> +  > [diff]
> +  > nodates = 1
> +  > EOF
>
>    $ stdin=`pwd`/stdin.tmp
>
> diff --git a/tests/test-mq.t b/tests/test-mq.t
> --- a/tests/test-mq.t
> +++ b/tests/test-mq.t
> @@ -5,11 +5,12 @@
>    >     fi
>    > }
>
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -
> -  $ echo "[mq]" >> $HGRCPATH
> -  $ echo "plain=true" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > [mq]
> +  > plain = true
> +  > EOF
>
>
>  help
> diff --git a/tests/test-record.t b/tests/test-record.t
> --- a/tests/test-record.t
> +++ b/tests/test-record.t
> @@ -1,9 +1,11 @@
>  Set up a repo
>
> -  $ echo "[ui]" >> $HGRCPATH
> -  $ echo "interactive=true" >> $HGRCPATH
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "record=" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [ui]
> +  > interactive = true
> +  > [extensions]
> +  > record =
> +  > EOF
>
>    $ hg init a
>    $ cd a
> diff --git a/tests/test-shelve.t b/tests/test-shelve.t
> --- a/tests/test-shelve.t
> +++ b/tests/test-shelve.t
> @@ -1,9 +1,11 @@
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "mq=" >> $HGRCPATH
> -  $ echo "shelve=" >> $HGRCPATH
> -  $ echo "[defaults]" >> $HGRCPATH
> -  $ echo "diff = --nodates --git" >> $HGRCPATH
> -  $ echo "qnew = --date '0 0'" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > mq =
> +  > shelve =
> +  > [defaults]
> +  > diff = --nodates --git
> +  > qnew = --date '0 0'
> +  > EOF
>
>    $ hg init repo
>    $ cd repo
> diff --git a/tests/test-status-color.t b/tests/test-status-color.t
> --- a/tests/test-status-color.t
> +++ b/tests/test-status-color.t
> @@ -1,7 +1,9 @@
> -  $ echo "[extensions]" >> $HGRCPATH
> -  $ echo "color=" >> $HGRCPATH
> -  $ echo "[color]" >> $HGRCPATH
> -  $ echo "mode=ansi" >> $HGRCPATH
> +  $ cat <<EOF >> $HGRCPATH
> +  > [extensions]
> +  > color =
> +  > [color]
> +  > mode = ansi
> +  > EOF
>  Terminfo codes compatibility fix
>    $ echo "color.none=0" >> $HGRCPATH
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list