exchance: add a common setup script for all test
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 03 Mar 2014 13:12:50 -0800
changeset 829 0943f327e2fb
parent 828 c362513b3c7e
child 830 f3b3a09ba312
exchance: add a common setup script for all test
tests/_exc-util.sh
tests/test-exchange-A1.t
tests/test-exchange-A2.t
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/_exc-util.sh	Mon Mar 03 13:12:50 2014 -0800
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+cat >> $HGRCPATH <<EOF
+[web]
+push_ssl = false
+allow_push = *
+[ui]
+logtemplate ="{node|short} ({phase}): {desc}\n"
+[phases]
+publish=False
+[extensions]
+hgext.rebase=
+EOF
+echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
+
+mkcommit() {
+   echo "$1" > "$1"
+   hg add "$1"
+   hg ci -m "$1"
+}
+getid() {
+   hg id --hidden --debug -ir "$1"
+}
--- a/tests/test-exchange-A1.t	Fri Feb 28 16:36:37 2014 -0800
+++ b/tests/test-exchange-A1.t	Mon Mar 03 13:12:50 2014 -0800
@@ -1,27 +1,7 @@
 
 Initial setup
 
-  $ cat >> $HGRCPATH <<EOF
-  > [web]
-  > push_ssl = false
-  > allow_push = *
-  > [ui]
-  > logtemplate ="{node|short} ({phase}): {desc}\n"
-  > [phases]
-  > publish=False
-  > [extensions]
-  > hgext.rebase=
-  > EOF
-  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
-
-  $ mkcommit() {
-  >    echo "$1" > "$1"
-  >    hg add "$1"
-  >    hg ci -m "$1"
-  > }
-  $ getid() {
-  >    hg id --hidden --debug -ir "$1"
-  > }
+  $ . $TESTDIR/_exc-util.sh
 
 ==== A.1.1 pushing a single head ====
 ..
--- a/tests/test-exchange-A2.t	Fri Feb 28 16:36:37 2014 -0800
+++ b/tests/test-exchange-A2.t	Mon Mar 03 13:12:50 2014 -0800
@@ -2,31 +2,7 @@
 
 Initial setup
 
-  $ cat >> $HGRCPATH <<EOF
-  > [web]
-  > push_ssl = false
-  > allow_push = *
-  > [ui]
-  > logtemplate ="{node|short} ({phase}): {desc}\n"
-  > [phases]
-  > publish=False
-  > [extensions]
-  > hgext.rebase=
-  > EOF
-  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
-
-  $ mkcommit() {
-  >    echo "$1" > "$1"
-  >    hg add "$1"
-  >    hg ci -m "$1"
-  > }
-  $ getid() {
-  >    hg id --hidden --debug -ir "$1"
-  > }
-
-
-
-
+  $ . $TESTDIR/_exc-util.sh
 
 === A.2 Two heads ===