# HG changeset patch # User Pierre-Yves David # Date 1393882073 28800 # Node ID f3b3a09ba312940c1f5452d234bf65e50049b809 # Parent 0943f327e2fb466c19219afe0c8ef5bce220c73c exchange: have a function doing all the common initial setup This will help creation of further test. diff -r 0943f327e2fb -r f3b3a09ba312 tests/_exc-util.sh --- a/tests/_exc-util.sh Mon Mar 03 13:12:50 2014 -0800 +++ b/tests/_exc-util.sh Mon Mar 03 13:27:53 2014 -0800 @@ -21,3 +21,20 @@ getid() { hg id --hidden --debug -ir "$1" } + +setuprepos() { + echo creating test repo for test case $1 + mkdir $1 + cd $1 + echo - pulldest + hg init pushdest + cd pushdest + mkcommit O + hg phase --public . + cd .. + echo - main + hg clone -q pushdest main + echo - pushdest + hg clone -q main pulldest + echo 'cd into `main` and proceed with env setup' +} diff -r 0943f327e2fb -r f3b3a09ba312 tests/test-exchange-A2.t --- a/tests/test-exchange-A2.t Mon Mar 03 13:12:50 2014 -0800 +++ b/tests/test-exchange-A2.t Mon Mar 03 13:27:53 2014 -0800 @@ -33,16 +33,13 @@ initial - $ mkdir A.2 - $ cd A.2 - $ hg init main - $ hg init pushdest - $ hg init pulldest + $ setuprepos A.2 + creating test repo for test case A.2 + - pulldest + - main + - pushdest + cd into `main` and proceed with env setup $ cd main - $ mkcommit O - $ hg phase --public . - $ hg push -q ../pushdest - $ hg push -q ../pulldest $ mkcommit A $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(A)'` $ hg up .^