Patchwork [1,of,5,V2] tests: update ui.interactive-related tests to write hgrc by shell heredoc

login
register
mail settings
Submitter Yuya Nishihara
Date Oct. 10, 2014, 3:09 p.m.
Message ID <8403d22546cca774976c.1412953757@mimosa>
Download mbox | patch
Permalink /patch/6174/
State Superseded
Headers show

Comments

Yuya Nishihara - Oct. 10, 2014, 3:09 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1412947613 -32400
#      Fri Oct 10 22:26:53 2014 +0900
# Node ID 8403d22546cca774976cca9e400d8df0e949b355
# Parent  e4b2beb54fbd39980b3dd7c5a263fd74d18d9b33
tests: update ui.interactive-related tests to write hgrc by shell heredoc

Here document is readable than repeating echo commands.
Pierre-Yves David - Oct. 18, 2014, 9:55 p.m.
On 10/10/2014 08:09 AM, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1412947613 -32400
> #      Fri Oct 10 22:26:53 2014 +0900
> # Node ID 8403d22546cca774976cca9e400d8df0e949b355
> # Parent  e4b2beb54fbd39980b3dd7c5a263fd74d18d9b33
> tests: update ui.interactive-related tests to write hgrc by shell heredoc

Patch 1 looks good to me and I would have be pushed it to the 
clowncopter if we were not so close to the freeze (not sur what mpm 
status is)
Yuya Nishihara - Oct. 19, 2014, 3:37 a.m.
On Sat, 18 Oct 2014 14:55:29 -0700, Pierre-Yves David wrote:
> On 10/10/2014 08:09 AM, Yuya Nishihara wrote:
> > # HG changeset patch
> > # User Yuya Nishihara <yuya@tcha.org>
> > # Date 1412947613 -32400
> > #      Fri Oct 10 22:26:53 2014 +0900
> > # Node ID 8403d22546cca774976cca9e400d8df0e949b355
> > # Parent  e4b2beb54fbd39980b3dd7c5a263fd74d18d9b33
> > tests: update ui.interactive-related tests to write hgrc by shell heredoc
> 
> Patch 1 looks good to me and I would have be pushed it to the 
> clowncopter if we were not so close to the freeze (not sur what mpm 
> status is)

I'll resend PATCH 1 post-3.2.

Patch

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
@@ -66,11 +66,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-issue3084.t b/tests/test-issue3084.t
--- a/tests/test-issue3084.t
+++ b/tests/test-issue3084.t
@@ -1,6 +1,8 @@ 
 
-  $ echo "[extensions]" >> $HGRCPATH
-  $ echo "largefiles =" >> $HGRCPATH
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > largefiles =
+  > EOF
 
 Create the repository outside $HOME since largefiles write to
 $HOME/.cache/largefiles.
diff --git a/tests/test-mq-qrefresh-interactive.t b/tests/test-mq-qrefresh-interactive.t
--- a/tests/test-mq-qrefresh-interactive.t
+++ b/tests/test-mq-qrefresh-interactive.t
@@ -1,12 +1,16 @@ 
 Create configuration
 
-  $ echo "[ui]" >> $HGRCPATH
-  $ echo "interactive=true" >> $HGRCPATH
+  $ cat <<EOF >> $HGRCPATH
+  > [ui]
+  > interactive = true
+  > EOF
 
 help qrefresh (no record)
 
-  $ echo "[extensions]" >> $HGRCPATH
-  $ echo "mq=" >> $HGRCPATH
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > mq =
+  > EOF
   $ hg help qrefresh
   hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
   
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-qrecord.t b/tests/test-qrecord.t
--- a/tests/test-qrecord.t
+++ b/tests/test-qrecord.t
@@ -1,7 +1,9 @@ 
 Create configuration
 
-  $ echo "[ui]" >> $HGRCPATH
-  $ echo "interactive=true" >> $HGRCPATH
+  $ cat <<EOF >> $HGRCPATH
+  > [ui]
+  > interactive = true
+  > EOF
 
 help record (no record)
 
@@ -20,8 +22,10 @@  help qrecord (no record)
   
   (use "hg help extensions" for information on enabling extensions)
 
-  $ echo "[extensions]"     >> $HGRCPATH
-  $ echo "record="          >> $HGRCPATH
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > record =
+  > EOF
 
 help record (record)
 
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