##// END OF EJS Templates
tests: avoid export FOO=bar bashism
Martin Geisler -
r8350:1f0f01bc default
parent child Browse files
Show More
@@ -1,103 +1,105
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" cvs cvsps || exit 80
4 4
5 5 cvscall()
6 6 {
7 7 cvs -f $@
8 8 }
9 9
10 10 hgcat()
11 11 {
12 12 hg --cwd src-hg cat -r tip "$1"
13 13 }
14 14
15 15 # Test legacy configuration with external cvsps
16 16 echo "[extensions]" >> $HGRCPATH
17 17 echo "convert = " >> $HGRCPATH
18 18 echo "graphlog = " >> $HGRCPATH
19 19 echo "[convert]" >> $HGRCPATH
20 20 echo "cvsps=cvsps -A -u --cvs-direct -q" >> $HGRCPATH
21 21
22 22 echo % create cvs repository
23 23 mkdir cvsrepo
24 24 cd cvsrepo
25 export CVSROOT=`pwd`
26 export CVS_OPTIONS=-f
25 CVSROOT=`pwd`
26 export CVSROOT
27 CVS_OPTIONS=-f
28 export CVS_OPTIONS
27 29 cd ..
28 30
29 31 cvscall -q -d "$CVSROOT" init
30 32
31 33 echo % create source directory
32 34 mkdir src-temp
33 35 cd src-temp
34 36 echo a > a
35 37 mkdir b
36 38 cd b
37 39 echo c > c
38 40 cd ..
39 41
40 42 echo % import source directory
41 43 cvscall -q import -m import src INITIAL start
42 44 cd ..
43 45
44 46 echo % checkout source directory
45 47 cvscall -q checkout src
46 48
47 49 echo % commit a new revision changing b/c
48 50 cd src
49 51 sleep 1
50 52 echo c >> b/c
51 53 cvscall -q commit -mci0 . | grep '<--' |\
52 54 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
53 55 cd ..
54 56
55 57 echo % convert fresh repo
56 58 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
57 59 hgcat a
58 60 hgcat b/c
59 61
60 62 echo % convert fresh repo with --filemap
61 63 echo include b/c > filemap
62 64 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
63 65 hgcat b/c
64 66 hg -R src-filemap log --template '#rev# #desc# files: #files#\n'
65 67
66 68 echo % commit new file revisions
67 69 cd src
68 70 echo a >> a
69 71 echo c >> b/c
70 72 cvscall -q commit -mci1 . | grep '<--' |\
71 73 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
72 74 cd ..
73 75
74 76 echo % convert again
75 77 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
76 78 hgcat a
77 79 hgcat b/c
78 80
79 81 echo % convert again with --filemap
80 82 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
81 83 hgcat b/c
82 84 hg -R src-filemap log --template '#rev# #desc# files: #files#\n'
83 85
84 86 echo % commit branch
85 87 cd src
86 88 cvs -q update -r1.1 b/c
87 89 cvs -q tag -b branch
88 90 cvs -q update -r branch > /dev/null
89 91 echo d >> b/c
90 92 cvs -q commit -mci2 . | grep '<--' |\
91 93 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
92 94 cd ..
93 95
94 96 echo % convert again
95 97 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
96 98 hgcat a
97 99 hgcat b/c
98 100
99 101 echo % convert again with --filemap
100 102 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
101 103 hgcat b/c
102 104 hg -R src-filemap log --template '#rev# #desc# files: #files#\n'
103 105 hg -R src-hg glog --template '#rev# (#branches#) #desc# files: #files#\n'
@@ -1,62 +1,64
1 1 #!/bin/sh
2 2
3 3 # This is http://www.selenic.com/mercurial/bts/issue1148
4 4
5 5 "$TESTDIR/hghave" cvs || exit 80
6 6
7 7 cvscall()
8 8 {
9 9 cvs -f "$@"
10 10 }
11 11
12 12 echo "[extensions]" >> $HGRCPATH
13 13 echo "convert = " >> $HGRCPATH
14 14 echo "graphlog = " >> $HGRCPATH
15 15 echo "[convert]" >> $HGRCPATH
16 16 echo "cvsps=builtin" >> $HGRCPATH
17 17 echo "cvsps.cache=0" >> $HGRCPATH
18 18
19 19 echo % create cvs repository
20 20 mkdir cvsrepo
21 21 cd cvsrepo
22 export CVSROOT=`pwd`
23 export CVS_OPTIONS=-f
22 CVSROOT=`pwd`
23 export CVSROOT
24 CVS_OPTIONS=-f
25 export CVS_OPTIONS
24 26 cd ..
25 27
26 28 cvscall -q -d "$CVSROOT" init
27 29
28 30 echo % Create a new project
29 31
30 32 mkdir src
31 33 cd src
32 34 echo "1" > a
33 35 echo "1" > b
34 36 cvscall import -m "init" src v0 r0 | sort
35 37 cd ..
36 38 cvscall co src
37 39 cd src
38 40
39 41 echo % Branch the project
40 42
41 43 cvscall tag -b BRANCH
42 44 cvscall up -r BRANCH > /dev/null
43 45
44 46 echo % Modify file a, then b, then a
45 47
46 48 echo "2" > a
47 49 cvscall ci -m "mod a" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
48 50
49 51 echo "2" > b
50 52 cvscall ci -m "mod b" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
51 53
52 54 echo "3" > a
53 55 cvscall ci -m "mod a again" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
54 56
55 57 echo % Convert
56 58
57 59 cd ..
58 60 hg convert src | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
59 61
60 62 echo % Check the result
61 63
62 64 hg -R src-hg glog --template '#rev# (#branches#) #desc# files: #files#\n'
@@ -1,121 +1,123
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" cvs || exit 80
4 4
5 5 cvscall()
6 6 {
7 7 cvs -f "$@"
8 8 }
9 9
10 10 hgcat()
11 11 {
12 12 hg --cwd src-hg cat -r tip "$1"
13 13 }
14 14
15 15 echo "[extensions]" >> $HGRCPATH
16 16 echo "convert = " >> $HGRCPATH
17 17 echo "graphlog = " >> $HGRCPATH
18 18 echo "[convert]" >> $HGRCPATH
19 19 echo "cvsps=builtin" >> $HGRCPATH
20 20
21 21 echo % create cvs repository
22 22 mkdir cvsrepo
23 23 cd cvsrepo
24 export CVSROOT=`pwd`
25 export CVS_OPTIONS=-f
24 CVSROOT=`pwd`
25 export CVSROOT
26 CVS_OPTIONS=-f
27 export CVS_OPTIONS
26 28 cd ..
27 29
28 30 cvscall -q -d "$CVSROOT" init
29 31
30 32 echo % create source directory
31 33 mkdir src-temp
32 34 cd src-temp
33 35 echo a > a
34 36 mkdir b
35 37 cd b
36 38 echo c > c
37 39 cd ..
38 40
39 41 echo % import source directory
40 42 cvscall -q import -m import src INITIAL start
41 43 cd ..
42 44
43 45 echo % checkout source directory
44 46 cvscall -q checkout src
45 47
46 48 echo % commit a new revision changing b/c
47 49 cd src
48 50 sleep 1
49 51 echo c >> b/c
50 52 cvscall -q commit -mci0 . | grep '<--' |\
51 53 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
52 54 cd ..
53 55
54 56 echo % convert fresh repo
55 57 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
56 58 hgcat a
57 59 hgcat b/c
58 60
59 61 echo % convert fresh repo with --filemap
60 62 echo include b/c > filemap
61 63 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
62 64 hgcat b/c
63 65 hg -R src-filemap log --template '#rev# #desc# files: #files#\n'
64 66
65 67 echo % commit new file revisions
66 68 cd src
67 69 echo a >> a
68 70 echo c >> b/c
69 71 cvscall -q commit -mci1 . | grep '<--' |\
70 72 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
71 73 cd ..
72 74
73 75 echo % convert again
74 76 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
75 77 hgcat a
76 78 hgcat b/c
77 79
78 80 echo % convert again with --filemap
79 81 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
80 82 hgcat b/c
81 83 hg -R src-filemap log --template '#rev# #desc# files: #files#\n'
82 84
83 85 echo % commit branch
84 86 cd src
85 87 cvs -q update -r1.1 b/c
86 88 cvs -q tag -b branch
87 89 cvs -q update -r branch > /dev/null
88 90 echo d >> b/c
89 91 cvs -q commit -mci2 . | grep '<--' |\
90 92 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
91 93 cd ..
92 94
93 95 echo % convert again
94 96 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
95 97 hgcat a
96 98 hgcat b/c
97 99
98 100 echo % convert again with --filemap
99 101 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
100 102 hgcat b/c
101 103 hg -R src-filemap log --template '#rev# #desc# files: #files#\n'
102 104
103 105 echo % commit a new revision with funny log message
104 106 cd src
105 107 sleep 1
106 108 echo e >> a
107 109 cvscall -q commit -m'funny
108 110 ----------------------------
109 111 log message' . | grep '<--' |\
110 112 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
111 113 cd ..
112 114
113 115 echo % convert again
114 116 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
115 117
116 118 echo "graphlog = " >> $HGRCPATH
117 119 hg -R src-hg glog --template '#rev# (#branches#) #desc# files: #files#\n'
118 120
119 121 echo % testing debugcvsps
120 122 cd src
121 123 hg debugcvsps | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'
@@ -1,78 +1,80
1 1 #!/bin/bash
2 2
3 3 "$TESTDIR/hghave" cvs || exit 80
4 4
5 5 cvscall()
6 6 {
7 7 cvs -f "$@"
8 8 }
9 9
10 10 hgcat()
11 11 {
12 12 hg --cwd src-hg cat -r tip "$1"
13 13 }
14 14
15 15 echo "[extensions]" >> $HGRCPATH
16 16 echo "convert = " >> $HGRCPATH
17 17 echo "graphlog = " >> $HGRCPATH
18 18 echo "[convert]" >> $HGRCPATH
19 19 echo "cvsps=builtin" >> $HGRCPATH
20 20
21 21 echo % create cvs repository
22 22 mkdir cvsmaster
23 23 cd cvsmaster
24 export CVSROOT=`pwd`
25 export CVS_OPTIONS=-f
24 CVSROOT=`pwd`
25 export CVSROOT
26 CVS_OPTIONS=-f
27 export CVS_OPTIONS
26 28 cd ..
27 29
28 30 cvscall -q -d "$CVSROOT" init
29 31
30 32 cvscall -q checkout -d cvsworktmp .
31 33 cd cvsworktmp
32 34 mkdir foo
33 35 cvscall -q add foo | sed -e 's/Directory .* added to the repository//g'
34 36 cd foo
35 37 echo foo > foo.txt
36 38 cvscall -q add foo.txt
37 39 cvscall -q ci -m "foo.txt" | sed 's/.*,v.*/checking in/g'
38 40
39 41 cd ../..
40 42 rm -rf cvsworktmp
41 43
42 44 cvscall -q checkout -d cvswork foo
43 45
44 46 cd cvswork
45 47
46 48 cvscall -q rtag -b -R MYBRANCH1 foo
47 49 cvscall -q up -P -r MYBRANCH1
48 50 echo bar > foo.txt
49 51 cvscall -q ci -m "bar" | sed 's/.*,v.*/checking in/g'
50 52 echo baz > foo.txt
51 53 cvscall -q ci -m "baz" | sed 's/.*,v.*/checking in/g'
52 54
53 55 cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
54 56 cvscall -q up -P -r MYBRANCH1_2
55 57
56 58 echo bazzie > foo.txt
57 59 cvscall -q ci -m "bazzie" | sed 's/.*,v.*/checking in/g'
58 60
59 61 cvscall -q rtag -b -R MYBRANCH1_1 foo
60 62 cvscall -q up -P -r MYBRANCH1_1
61 63
62 64 echo quux > foo.txt
63 65 cvscall -q ci -m "quux" | sed 's/.*,v.*/checking in/g'
64 66 cvscall -q up -P -jMYBRANCH1 | sed 's/RCS file: .*,v/merging MYBRANCH1/g'
65 67 echo xyzzy > foo.txt
66 68 cvscall -q ci -m "merge" | sed 's/.*,v.*/checking in/g'
67 69
68 70 cvscall -q up -P -A
69 71
70 72 cvscall -q up -P -jMYBRANCH1_2 | sed 's/RCS file: .*,v/merging MYBRANCH1_2/g'
71 73 cvscall -q ci -m "merge" | sed 's/.*,v.*/checking in/g'
72 74
73 75 REALCVS=`which cvs`
74 76 echo "for x in \$*; do if [ \"\$x\" = \"rlog\" ]; then echo \"RCS file: $CVSROOT/foo/foo.txt,v\"; cat $TESTDIR/test-convert-cvs-builtincvsps-cvsnt-mergepoints.rlog; exit 0; fi; done; $REALCVS \$*" > cvs
75 77 chmod +x cvs
76 78 PATH=.:${PATH} hg debugcvsps --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'
77 79
78 80 cd ..
@@ -1,116 +1,117
1 1 #!/bin/sh
2 2
3 3 # Test config convert.cvsps.mergefrom config setting.
4 4 # (Should test similar mergeto feature, but I don't understand it yet.)
5 5 # Requires builtin cvsps.
6 6
7 7 "$TESTDIR/hghave" cvs || exit 80
8 8
9 export CVSROOT=`pwd`/cvsrepo
9 CVSROOT=`pwd`/cvsrepo
10 export CVSROOT
10 11
11 12 # XXX copied from test-convert-cvs-synthetic
12 13 cvscall()
13 14 {
14 15 echo cvs -f "$@"
15 16 cvs -f "$@"
16 17 }
17 18
18 19 # output of 'cvs ci' varies unpredictably, so just discard it
19 20 # XXX copied from test-convert-cvs-synthetic
20 21 cvsci()
21 22 {
22 23 echo cvs -f ci "$@"
23 24 cvs -f ci "$@" >/dev/null 2>&1
24 25 }
25 26
26 27 # XXX copied from test-convert-cvs-synthetic
27 28 filterpath()
28 29 {
29 30 eval "$@" | sed "s:$CVSROOT:*REPO*:g"
30 31 }
31 32
32 33 echo "[extensions]" >> $HGRCPATH
33 34 echo "convert = " >> $HGRCPATH
34 35 echo "graphlog = " >> $HGRCPATH
35 36 echo "[convert]" >> $HGRCPATH
36 37 echo "cvsps=builtin" >> $HGRCPATH
37 38 echo "cvsps.cache=0" >> $HGRCPATH
38 39 echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH
39 40
40 41 echo % create cvs repository with one project
41 42 mkdir cvsrepo
42 43
43 44 filterpath cvscall -q -d "$CVSROOT" init
44 45 mkdir cvsrepo/proj
45 46
46 47 echo % populate cvs repository
47 48 cvscall -Q co proj
48 49 cd proj
49 50 touch file1
50 51 cvscall -Q add file1
51 52 cvsci -m"add file1 on trunk"
52 53
53 54 echo % create two release branches
54 55 cvscall -q tag -b v1_0
55 56 cvscall -q tag -b v1_1
56 57
57 58 echo % modify file1 on branch v1_0
58 59 filterpath cvscall -Q update -rv1_0
59 60 echo "change" >> file1
60 61 cvsci -m"add text"
61 62
62 63 echo % make unrelated change on v1_1
63 64 cvscall -Q update -rv1_1
64 65 touch unrelated
65 66 cvscall -Q add unrelated
66 67 cvsci -m"unrelated change"
67 68
68 69 echo % merge file1 to v1_1
69 70 filterpath cvscall -Q update -jv1_0
70 71 cvsci -m"add text [MERGE from v1_0]"
71 72
72 73 echo % merge change to trunk
73 74 cvscall -Q update -A
74 75 filterpath cvscall -Q update -jv1_1
75 76 cvsci -m"add text [MERGE from v1_1]"
76 77
77 78 echo % non-merged change on trunk
78 79 echo "foo" > file2
79 80 cvscall -Q add file2
80 81 cvsci -m"add file2 on trunk" file2
81 82
82 83 # this will create rev 1.3
83 84 echo % change on trunk to backport
84 85 echo "backport me" >> file1
85 86 cvsci -m"add other text" file1
86 87 cvscall log file1 | sed -n '/^date: / d; /^revision /,$ p;'
87 88
88 89 # XXX how many ways are there to spell "trunk" with CVS?
89 90 echo % backport trunk change to v1_1
90 91 cvscall -Q update -rv1_1
91 92 filterpath cvscall -Q update -j1.2 -j1.3 file1
92 93 cvsci -m"add other text [MERGE from HEAD]" file1
93 94
94 95 set -e
95 96 echo "% fix bug on v1_1, merge to trunk with error"
96 97 cvscall -Q update -rv1_1
97 98 echo "merge forward" >> file1
98 99 cvscall -Q tag unmerged
99 100 cvsci -m"fix file1"
100 101 cvscall -Q update -A
101 102 filterpath cvscall -Q update -junmerged -jv1_1
102 103 # note the typo in the commit log message
103 104 cvsci -m"fix file1 [MERGE from v1-1]"
104 105 cvs -Q tag -d unmerged
105 106
106 107 set -e
107 108 echo % convert to hg
108 109 cd ..
109 110 filterpath hg convert proj proj.hg
110 111
111 112 echo % complete log
112 113 template="{rev}: '{branches}' {desc}\n"
113 114 hg -R proj.hg log --template="$template"
114 115
115 116 echo % graphical log
116 117 hg -R proj.hg glog --template="$template"
@@ -1,118 +1,120
1 1 #!/bin/sh
2 2
3 3 # This feature requires use of builtin cvsps!
4 4 "$TESTDIR/hghave" cvs || exit 80
5 5
6 6 set -e
7 7
8 8 echo "[extensions]" >> $HGRCPATH
9 9 echo "convert = " >> $HGRCPATH
10 10 echo "graphlog = " >> $HGRCPATH
11 11 echo "[convert]" >> $HGRCPATH
12 12 echo "cvsps=builtin" >> $HGRCPATH
13 13
14 14 echo % create cvs repository with one project
15 15 mkdir cvsrepo
16 16 cd cvsrepo
17 export CVSROOT=`pwd`
18 export CVS_OPTIONS=-f
17 CVSROOT=`pwd`
18 export CVSROOT
19 CVS_OPTIONS=-f
20 export CVS_OPTIONS
19 21 cd ..
20 22
21 23 filterpath()
22 24 {
23 25 eval "$@" | sed "s:$CVSROOT:*REPO*:g"
24 26 }
25 27
26 28 cvscall()
27 29 {
28 30 echo cvs -f "$@"
29 31 cvs -f "$@" 2>&1
30 32 }
31 33
32 34 # output of 'cvs ci' varies unpredictably, so just discard it
33 35 cvsci()
34 36 {
35 37 echo cvs -f ci "$@"
36 38 cvs -f ci "$@" >/dev/null 2>&1
37 39 }
38 40
39 41 filterpath cvscall -d "$CVSROOT" init
40 42 mkdir cvsrepo/proj
41 43
42 44 cvscall -q co proj
43 45
44 46 echo % create file1 on the trunk
45 47 cd proj
46 48 touch file1
47 49 cvscall -Q add file1
48 50 cvsci -m"add file1 on trunk" file1
49 51
50 52 echo % create two branches
51 53 cvscall -q tag -b v1_0
52 54 cvscall -q tag -b v1_1
53 55
54 56 echo % create file2 on branch v1_0
55 57 cvscall -Q up -rv1_0
56 58 touch file2
57 59 cvscall -Q add file2
58 60 cvsci -m"add file2" file2
59 61
60 62 echo % create file3, file4 on branch v1_1
61 63 cvscall -Q up -rv1_1
62 64 touch file3
63 65 touch file4
64 66 cvscall -Q add file3 file4
65 67 cvsci -m"add file3, file4 on branch v1_1" file3 file4
66 68
67 69 echo % merge file2 from v1_0 to v1_1
68 70 cvscall -Q up -jv1_0
69 71 cvsci -m"MERGE from v1_0: add file2"
70 72
71 73 # Step things up a notch: now we make the history really hairy, with
72 74 # changes bouncing back and forth between trunk and v1_2 and merges
73 75 # going both ways. (I.e., try to model the real world.)
74 76
75 77 echo "% create branch v1_2"
76 78 cvscall -Q up -A
77 79 cvscall -q tag -b v1_2
78 80
79 81 echo "% create file5 on branch v1_2"
80 82 cvscall -Q up -rv1_2
81 83 touch file5
82 84 cvs -Q add file5
83 85 cvsci -m"add file5 on v1_2"
84 86
85 87 echo "% create file6 on trunk post-v1_2"
86 88 cvscall -Q up -A
87 89 touch file6
88 90 cvscall -Q add file6
89 91 cvsci -m"add file6 on trunk post-v1_2"
90 92
91 93 echo "% merge file5 from v1_2 to trunk"
92 94 cvscall -Q up -A
93 95 cvscall -Q up -jv1_2 file5
94 96 cvsci -m"MERGE from v1_2: add file5"
95 97
96 98 echo "% merge file6 from trunk to v1_2"
97 99 cvscall -Q up -rv1_2
98 100 cvscall up -jHEAD file6
99 101 cvsci -m"MERGE from HEAD: add file6"
100 102
101 103 echo % cvs rlog output
102 104 filterpath cvscall -q rlog proj | egrep '^(RCS file|revision)'
103 105
104 106 echo "% convert to hg (#1)"
105 107 cd ..
106 108 filterpath hg convert --datesort proj proj.hg
107 109
108 110 echo "% hg glog output (#1)"
109 111 hg -R proj.hg glog --template "{rev} {desc}\n"
110 112
111 113 echo "% convert to hg (#2: with merge detection)"
112 114 filterpath hg convert \
113 115 --config convert.cvsps.mergefrom="\"^MERGE from (\S+):\"" \
114 116 --datesort \
115 117 proj proj.hg2
116 118
117 119 echo "% hg glog output (#2)"
118 120 hg -R proj.hg2 glog --template "{rev} {desc}\n"
General Comments 0
You need to be logged in to leave comments. Login now