##// END OF EJS Templates
tests: remove more instances of export FOO=bar bashism
Brodie Rao -
r9043:438f0b1d default
parent child Browse files
Show More
@@ -1,19 +1,19 b''
1 # this file holds the definitions that are used in various bzr tests
1 # this file holds the definitions that are used in various bzr tests
2
2
3 "$TESTDIR/hghave" bzr || exit 80
3 "$TESTDIR/hghave" bzr || exit 80
4
4
5 export TERM=dumb
5 TERM=dumb; export TERM
6 echo '[extensions]' >> $HGRCPATH
6 echo '[extensions]' >> $HGRCPATH
7 echo 'convert = ' >> $HGRCPATH
7 echo 'convert = ' >> $HGRCPATH
8 echo 'hgext.graphlog = ' >> $HGRCPATH
8 echo 'hgext.graphlog = ' >> $HGRCPATH
9
9
10 glog()
10 glog()
11 {
11 {
12 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
12 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
13 }
13 }
14
14
15 manifest()
15 manifest()
16 {
16 {
17 echo "% manifest of $2"
17 echo "% manifest of $2"
18 hg -R $1 manifest -v -r $2
18 hg -R $1 manifest -v -r $2
19 }
19 }
@@ -1,75 +1,75 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" p4 || exit 80
3 "$TESTDIR/hghave" p4 || exit 80
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "convert = " >> $HGRCPATH
6 echo "convert = " >> $HGRCPATH
7
7
8 echo % create p4 depot
8 echo % create p4 depot
9 export P4ROOT=$PWD/depot
9 P4ROOT=$PWD/depot; export P4ROOT
10 export P4AUDIT=$P4ROOT/audit
10 P4AUDIT=$P4ROOT/audit; export P4AUDIT
11 export P4JOURNAL=$P4ROOT/journal
11 P4JOURNAL=$P4ROOT/journal; export P4JOURNAL
12 export P4LOG=$P4ROOT/log
12 P4LOG=$P4ROOT/log; export P4LOG
13 export P4PORT=localhost:16661
13 P4PORT=localhost:16661; export P4PORT
14 export P4DEBUG=1
14 P4DEBUG=1; export P4DEBUG
15
15
16 echo % start the p4 server
16 echo % start the p4 server
17 [ ! -d $P4ROOT ] && mkdir $P4ROOT
17 [ ! -d $P4ROOT ] && mkdir $P4ROOT
18 p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr &
18 p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr &
19 trap "echo % stop the p4 server ; p4 admin stop" EXIT
19 trap "echo % stop the p4 server ; p4 admin stop" EXIT
20
20
21 # wait for the server to initialize
21 # wait for the server to initialize
22 while ! p4 ; do
22 while ! p4 ; do
23 sleep 1
23 sleep 1
24 done >/dev/null 2>/dev/null
24 done >/dev/null 2>/dev/null
25
25
26 echo % create a client spec
26 echo % create a client spec
27 export P4CLIENT=hg-p4-import
27 P4CLIENT=hg-p4-import; export P4CLIENT
28 DEPOTPATH=//depot/test-mercurial-import/...
28 DEPOTPATH=//depot/test-mercurial-import/...
29 p4 client -o | sed '/^View:/,$ d' >p4client
29 p4 client -o | sed '/^View:/,$ d' >p4client
30 echo View: >>p4client
30 echo View: >>p4client
31 echo " $DEPOTPATH //$P4CLIENT/..." >>p4client
31 echo " $DEPOTPATH //$P4CLIENT/..." >>p4client
32 p4 client -i <p4client
32 p4 client -i <p4client
33
33
34 echo % populate the depot
34 echo % populate the depot
35 echo a > a
35 echo a > a
36 mkdir b
36 mkdir b
37 echo c > b/c
37 echo c > b/c
38 p4 add a b/c
38 p4 add a b/c
39 p4 submit -d initial
39 p4 submit -d initial
40
40
41 echo % change some files
41 echo % change some files
42 p4 edit a
42 p4 edit a
43 echo aa >> a
43 echo aa >> a
44 p4 submit -d "change a"
44 p4 submit -d "change a"
45
45
46 p4 edit b/c
46 p4 edit b/c
47 echo cc >> b/c
47 echo cc >> b/c
48 p4 submit -d "change b/c"
48 p4 submit -d "change b/c"
49
49
50 echo % convert
50 echo % convert
51 hg convert -s p4 $DEPOTPATH dst
51 hg convert -s p4 $DEPOTPATH dst
52 hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'
52 hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'
53
53
54 echo % change some files
54 echo % change some files
55 p4 edit a b/c
55 p4 edit a b/c
56 echo aaa >> a
56 echo aaa >> a
57 echo ccc >> b/c
57 echo ccc >> b/c
58 p4 submit -d "change a b/c"
58 p4 submit -d "change a b/c"
59
59
60 echo % convert again
60 echo % convert again
61 hg convert -s p4 $DEPOTPATH dst
61 hg convert -s p4 $DEPOTPATH dst
62 hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'
62 hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'
63
63
64 echo % interesting names
64 echo % interesting names
65 echo dddd > "d d"
65 echo dddd > "d d"
66 mkdir " e"
66 mkdir " e"
67 echo fff >" e/ f"
67 echo fff >" e/ f"
68 p4 add "d d" " e/ f"
68 p4 add "d d" " e/ f"
69 p4 submit -d "add d e f"
69 p4 submit -d "add d e f"
70
70
71 echo % convert again
71 echo % convert again
72 hg convert -s p4 $DEPOTPATH dst
72 hg convert -s p4 $DEPOTPATH dst
73 hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'
73 hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'
74
74
75
75
@@ -1,104 +1,104 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" p4 execbit symlink || exit 80
3 "$TESTDIR/hghave" p4 execbit symlink || exit 80
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "convert = " >> $HGRCPATH
6 echo "convert = " >> $HGRCPATH
7
7
8 echo % create p4 depot
8 echo % create p4 depot
9 export P4ROOT=$PWD/depot
9 P4ROOT=$PWD/depot; export P4ROOT
10 export P4AUDIT=$P4ROOT/audit
10 P4AUDIT=$P4ROOT/audit; export P4AUDIT
11 export P4JOURNAL=$P4ROOT/journal
11 P4JOURNAL=$P4ROOT/journal; export P4JOURNAL
12 export P4LOG=$P4ROOT/log
12 P4LOG=$P4ROOT/log; export P4LOG
13 export P4PORT=localhost:16661
13 P4PORT=localhost:16661; export P4PORT
14 export P4DEBUG=1
14 P4DEBUG=1; export P4DEBUG
15 export P4CHARSET=utf8
15 P4CHARSET=utf8; export P4CHARSET
16
16
17 echo % start the p4 server
17 echo % start the p4 server
18 [ ! -d $P4ROOT ] && mkdir $P4ROOT
18 [ ! -d $P4ROOT ] && mkdir $P4ROOT
19 p4d -f -J off -xi >$P4ROOT/stdout 2>$P4ROOT/stderr
19 p4d -f -J off -xi >$P4ROOT/stdout 2>$P4ROOT/stderr
20 p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr &
20 p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr &
21 trap "echo % stop the p4 server ; p4 admin stop" EXIT
21 trap "echo % stop the p4 server ; p4 admin stop" EXIT
22
22
23 # wait for the server to initialize
23 # wait for the server to initialize
24 while ! p4 ; do
24 while ! p4 ; do
25 sleep 1
25 sleep 1
26 done >/dev/null 2>/dev/null
26 done >/dev/null 2>/dev/null
27
27
28 echo % create a client spec
28 echo % create a client spec
29 export P4CLIENT=hg-p4-import
29 P4CLIENT=hg-p4-import; export P4CLIENT
30 DEPOTPATH=//depot/test-mercurial-import/...
30 DEPOTPATH=//depot/test-mercurial-import/...
31 p4 client -o | sed '/^View:/,$ d' >p4client
31 p4 client -o | sed '/^View:/,$ d' >p4client
32 echo View: >>p4client
32 echo View: >>p4client
33 echo " $DEPOTPATH //$P4CLIENT/..." >>p4client
33 echo " $DEPOTPATH //$P4CLIENT/..." >>p4client
34 p4 client -i <p4client
34 p4 client -i <p4client
35
35
36 echo % populate the depot
36 echo % populate the depot
37 TYPES="text binary symlink"
37 TYPES="text binary symlink"
38 TYPES="$TYPES text+m text+w text+x text+k text+kx text+ko text+l text+C text+D text+F text+S text+S2"
38 TYPES="$TYPES text+m text+w text+x text+k text+kx text+ko text+l text+C text+D text+F text+S text+S2"
39 TYPES="$TYPES binary+k binary+x binary+kx symlink+k"
39 TYPES="$TYPES binary+k binary+x binary+kx symlink+k"
40 TYPES="$TYPES ctext cxtext ktext kxtext ltext tempobj ubinary uxbinary xbinary xltext xtempobj xtext"
40 TYPES="$TYPES ctext cxtext ktext kxtext ltext tempobj ubinary uxbinary xbinary xltext xtempobj xtext"
41 # not testing these
41 # not testing these
42 #TYPES="$TYPES apple resource unicode utf16 uresource xunicode xutf16"
42 #TYPES="$TYPES apple resource unicode utf16 uresource xunicode xutf16"
43 for T in $TYPES ; do
43 for T in $TYPES ; do
44 T2=`echo $T | tr [:upper:] [:lower:]`
44 T2=`echo $T | tr [:upper:] [:lower:]`
45 case $T in
45 case $T in
46 apple)
46 apple)
47 ;;
47 ;;
48 symlink*)
48 symlink*)
49 echo "this is target $T" >target_$T2
49 echo "this is target $T" >target_$T2
50 ln -s target_$T file_$T2
50 ln -s target_$T file_$T2
51 p4 add target_$T2
51 p4 add target_$T2
52 p4 add -t $T file_$T2
52 p4 add -t $T file_$T2
53 ;;
53 ;;
54 binary*)
54 binary*)
55 python -c "file('file_$T2', 'wb').write('this is $T')"
55 python -c "file('file_$T2', 'wb').write('this is $T')"
56 p4 add -t $T file_$T2
56 p4 add -t $T file_$T2
57 ;;
57 ;;
58 *)
58 *)
59 echo "this is $T" >file_$T2
59 echo "this is $T" >file_$T2
60 p4 add -t $T file_$T2
60 p4 add -t $T file_$T2
61 ;;
61 ;;
62 esac
62 esac
63 done
63 done
64 p4 submit -d initial
64 p4 submit -d initial
65
65
66 echo % test keyword expansion
66 echo % test keyword expansion
67 p4 edit file_* target_*
67 p4 edit file_* target_*
68 for T in $TYPES ; do
68 for T in $TYPES ; do
69 T2=`echo $T | tr [:upper:] [:lower:]`
69 T2=`echo $T | tr [:upper:] [:lower:]`
70 echo '$Id$' >>file_$T2
70 echo '$Id$' >>file_$T2
71 echo '$Header$' >>file_$T2
71 echo '$Header$' >>file_$T2
72 echo '$Date$' >>file_$T2
72 echo '$Date$' >>file_$T2
73 echo '$DateTime$' >>file_$T2
73 echo '$DateTime$' >>file_$T2
74 echo '$Change$' >>file_$T2
74 echo '$Change$' >>file_$T2
75 echo '$File$' >>file_$T2
75 echo '$File$' >>file_$T2
76 echo '$Revision$' >>file_$T2
76 echo '$Revision$' >>file_$T2
77 echo '$Header$$Header$Header$' >>file_$T2
77 echo '$Header$$Header$Header$' >>file_$T2
78 done
78 done
79
79
80 ln -s 'target_$Header$' crazy_symlink+k
80 ln -s 'target_$Header$' crazy_symlink+k
81 p4 add -t symlink+k crazy_symlink+k
81 p4 add -t symlink+k crazy_symlink+k
82
82
83 p4 submit -d keywords
83 p4 submit -d keywords
84
84
85 echo % check keywords in p4
85 echo % check keywords in p4
86 grep -H Header file_*
86 grep -H Header file_*
87
87
88 echo % convert
88 echo % convert
89 hg convert -s p4 $DEPOTPATH dst
89 hg convert -s p4 $DEPOTPATH dst
90 hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'g
90 hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'g
91
91
92 echo % revision 0
92 echo % revision 0
93 hg -R dst update 0
93 hg -R dst update 0
94 head dst/file_* | cat -v
94 head dst/file_* | cat -v
95
95
96 echo
96 echo
97 echo % revision 1
97 echo % revision 1
98 hg -R dst update 1
98 hg -R dst update 1
99 head dst/file_* | cat -v
99 head dst/file_* | cat -v
100 echo
100 echo
101 echo % crazy_symlink
101 echo % crazy_symlink
102 readlink crazy_symlink+k
102 readlink crazy_symlink+k
103 readlink dst/crazy_symlink+k
103 readlink dst/crazy_symlink+k
104
104
General Comments 0
You need to be logged in to leave comments. Login now