annotate tests/_exc-util.sh @ 830:f3b3a09ba312

exchange: have a function doing all the common initial setup This will help creation of further test.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 03 Mar 2014 13:27:53 -0800
parents 0943f327e2fb
children a6af6919888d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
829
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
1 #!/bin/sh
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
2
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
3 cat >> $HGRCPATH <<EOF
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
4 [web]
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
5 push_ssl = false
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
6 allow_push = *
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
7 [ui]
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
8 logtemplate ="{node|short} ({phase}): {desc}\n"
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
9 [phases]
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
10 publish=False
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
11 [extensions]
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
12 hgext.rebase=
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
13 EOF
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
14 echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
15
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
16 mkcommit() {
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
17 echo "$1" > "$1"
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
18 hg add "$1"
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
19 hg ci -m "$1"
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
20 }
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
21 getid() {
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
22 hg id --hidden --debug -ir "$1"
0943f327e2fb exchance: add a common setup script for all test
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
23 }
830
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
24
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
25 setuprepos() {
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
26 echo creating test repo for test case $1
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
27 mkdir $1
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
28 cd $1
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
29 echo - pulldest
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
30 hg init pushdest
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
31 cd pushdest
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
32 mkcommit O
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
33 hg phase --public .
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
34 cd ..
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
35 echo - main
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
36 hg clone -q pushdest main
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
37 echo - pushdest
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
38 hg clone -q main pulldest
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
39 echo 'cd into `main` and proceed with env setup'
f3b3a09ba312 exchange: have a function doing all the common initial setup
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 829
diff changeset
40 }