##// END OF EJS Templates
Fix test-convert-cvsnt-mergepoints so it works reliably....
Greg Ward -
r8821:c66e324d default
parent child Browse files
Show More
@@ -1,99 +1,104 b''
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" cvs || exit 80
4 4
5 5 filterpath()
6 6 {
7 7 eval "$@" | sed "s:$CVSROOT:*REPO*:g"
8 8 }
9 9
10 10 cvscall()
11 11 {
12 12 echo cvs -f "$@"
13 13 cvs -f "$@"
14 14 }
15 15
16 16 # output of 'cvs ci' varies unpredictably, so discard most of it
17 17 # -- just keep the part that matters
18 18 cvsci()
19 19 {
20 echo cvs -f ci "$@"
21 cvs -f ci "$@" 2>&1 | egrep "^(new|initial) revision:"
20 echo cvs -f ci -f "$@"
21 cvs -f ci -f "$@" 2>&1 | egrep "^(new|initial) revision:"
22 22 }
23 23
24 24 hgcat()
25 25 {
26 26 hg --cwd src-hg cat -r tip "$1"
27 27 }
28 28
29 29 echo "[extensions]" >> $HGRCPATH
30 30 echo "convert = " >> $HGRCPATH
31 31 echo "graphlog = " >> $HGRCPATH
32 32 echo "[convert]" >> $HGRCPATH
33 33 echo "cvsps=builtin" >> $HGRCPATH
34 34
35 35 echo "% create cvs repository"
36 36 mkdir cvsmaster
37 37 cd cvsmaster
38 38 CVSROOT=`pwd`
39 39 export CVSROOT
40 40 CVS_OPTIONS=-f
41 41 export CVS_OPTIONS
42 42 cd ..
43 43 filterpath cvscall -Q -d "$CVSROOT" init
44 44
45 45 echo "% checkout #1: add foo.txt"
46 46 cvscall -Q checkout -d cvsworktmp .
47 47 cd cvsworktmp
48 48 mkdir foo
49 49 cvscall -Q add foo
50 50 cd foo
51 51 echo foo > foo.txt
52 52 cvscall -Q add foo.txt
53 cvsci -m "foo.txt"
53 cvsci -m "add foo.txt" foo.txt
54 54
55 55 cd ../..
56 56 rm -rf cvsworktmp
57 57
58 58 echo "% checkout #2: create MYBRANCH1 and modify foo.txt on it"
59 59 cvscall -Q checkout -d cvswork foo
60 60
61 61 cd cvswork
62 62
63 63 cvscall -q rtag -b -R MYBRANCH1 foo
64 64 cvscall -Q update -P -r MYBRANCH1
65 65 echo bar > foo.txt
66 cvsci -m "bar"
66 cvsci -m "bar" foo.txt
67 67 echo baz > foo.txt
68 cvsci -m "baz"
68 cvsci -m "baz" foo.txt
69 69
70 70 echo "% create MYBRANCH1_2 and modify foo.txt some more"
71 71 cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
72 72 cvscall -Q update -P -r MYBRANCH1_2
73 73
74 74 echo bazzie > foo.txt
75 cvsci -m "bazzie"
75 cvsci -m "bazzie" foo.txt
76 76
77 77 echo "% create MYBRANCH1_1 and modify foo.txt yet again"
78 78 cvscall -q rtag -b -R MYBRANCH1_1 foo
79 79 cvscall -Q update -P -r MYBRANCH1_1
80 80
81 81 echo quux > foo.txt
82 cvsci -m "quux"
82 cvsci -m "quux" foo.txt
83 83
84 84 echo "% merge MYBRANCH1 to MYBRANCH1_1"
85 85 filterpath cvscall -Q update -P -jMYBRANCH1
86 # carefully placed sleep to dodge cvs bug (optimization?) where it
87 # sometimes ignores a "commit" command if it comes too fast (the -f
88 # option in cvsci seems to work for all the other commits in this
89 # script)
90 sleep 1
86 91 echo xyzzy > foo.txt
87 cvsci -m "merge1"
92 cvsci -m "merge1+clobber" foo.txt
88 93
89 94 echo "% return to trunk and merge MYBRANCH1_2"
90 95 cvscall -Q update -P -A
91 96 filterpath cvscall -Q update -P -jMYBRANCH1_2
92 cvsci -m "merge2"
97 cvsci -m "merge2" foo.txt
93 98
94 99 REALCVS=`which cvs`
95 100 echo "for x in \$*; do if [ \"\$x\" = \"rlog\" ]; then echo \"RCS file: $CVSROOT/foo/foo.txt,v\"; cat $TESTDIR/test-convert-cvsnt-mergepoints.rlog; exit 0; fi; done; $REALCVS \$*" > ../cvs
96 101 chmod +x ../cvs
97 102 PATH=..:${PATH} hg debugcvsps --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'
98 103
99 104 cd ..
@@ -1,140 +1,140 b''
1 1 % create cvs repository
2 2 cvs -f -Q -d *REPO* init
3 3 % checkout #1: add foo.txt
4 4 cvs -f -Q checkout -d cvsworktmp .
5 5 cvs -f -Q add foo
6 6 cvs -f -Q add foo.txt
7 cvs -f ci -m foo.txt
7 cvs -f ci -f -m add foo.txt foo.txt
8 8 initial revision: 1.1
9 9 % checkout #2: create MYBRANCH1 and modify foo.txt on it
10 10 cvs -f -Q checkout -d cvswork foo
11 11 cvs -f -q rtag -b -R MYBRANCH1 foo
12 12 cvs -f -Q update -P -r MYBRANCH1
13 cvs -f ci -m bar
13 cvs -f ci -f -m bar foo.txt
14 14 new revision: 1.1.2.1; previous revision: 1.1
15 cvs -f ci -m baz
15 cvs -f ci -f -m baz foo.txt
16 16 new revision: 1.1.2.2; previous revision: 1.1.2.1
17 17 % create MYBRANCH1_2 and modify foo.txt some more
18 18 cvs -f -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
19 19 cvs -f -Q update -P -r MYBRANCH1_2
20 cvs -f ci -m bazzie
20 cvs -f ci -f -m bazzie foo.txt
21 21 new revision: 1.1.2.2.2.1; previous revision: 1.1.2.2
22 22 % create MYBRANCH1_1 and modify foo.txt yet again
23 23 cvs -f -q rtag -b -R MYBRANCH1_1 foo
24 24 cvs -f -Q update -P -r MYBRANCH1_1
25 cvs -f ci -m quux
25 cvs -f ci -f -m quux foo.txt
26 26 new revision: 1.1.4.1; previous revision: 1.1
27 27 % merge MYBRANCH1 to MYBRANCH1_1
28 28 rcsmerge: warning: conflicts during merge
29 29 cvs -f -Q update -P -jMYBRANCH1
30 30 RCS file: *REPO*/foo/foo.txt,v
31 31 retrieving revision 1.1
32 32 retrieving revision 1.1.2.2
33 33 Merging differences between 1.1 and 1.1.2.2 into foo.txt
34 cvs -f ci -m merge1
34 cvs -f ci -f -m merge1+clobber foo.txt
35 35 new revision: 1.1.4.2; previous revision: 1.1.4.1
36 36 % return to trunk and merge MYBRANCH1_2
37 37 cvs -f -Q update -P -A
38 38 cvs -f -Q update -P -jMYBRANCH1_2
39 39 RCS file: *REPO*/foo/foo.txt,v
40 40 retrieving revision 1.1
41 41 retrieving revision 1.1.2.2.2.1
42 42 Merging differences between 1.1 and 1.1.2.2.2.1 into foo.txt
43 cvs -f ci -m merge2
43 cvs -f ci -f -m merge2 foo.txt
44 44 new revision: 1.2; previous revision: 1.1
45 45 collecting CVS rlog
46 46 7 log entries
47 47 creating changesets
48 48 7 changeset entries
49 49 ---------------------
50 50 PatchSet 1
51 51 Date:
52 52 Author:
53 53 Branch: HEAD
54 54 Tag: (none)
55 55 Branchpoints: MYBRANCH1_1, MYBRANCH1
56 56 Log:
57 57 foo.txt
58 58
59 59 Members:
60 60 foo.txt:INITIAL->1.1
61 61
62 62 ---------------------
63 63 PatchSet 2
64 64 Date:
65 65 Author:
66 66 Branch: MYBRANCH1
67 67 Tag: (none)
68 68 Parent: 1
69 69 Log:
70 70 bar
71 71
72 72 Members:
73 73 foo.txt:1.1->1.1.2.1
74 74
75 75 ---------------------
76 76 PatchSet 3
77 77 Date:
78 78 Author:
79 79 Branch: MYBRANCH1
80 80 Tag: (none)
81 81 Branchpoints: MYBRANCH1_2
82 82 Parent: 2
83 83 Log:
84 84 baz
85 85
86 86 Members:
87 87 foo.txt:1.1.2.1->1.1.2.2
88 88
89 89 ---------------------
90 90 PatchSet 4
91 91 Date:
92 92 Author:
93 93 Branch: MYBRANCH1_1
94 94 Tag: (none)
95 95 Parent: 1
96 96 Log:
97 97 quux
98 98
99 99 Members:
100 100 foo.txt:1.1->1.1.4.1
101 101
102 102 ---------------------
103 103 PatchSet 5
104 104 Date:
105 105 Author:
106 106 Branch: MYBRANCH1_2
107 107 Tag: (none)
108 108 Parent: 3
109 109 Log:
110 110 bazzie
111 111
112 112 Members:
113 113 foo.txt:1.1.2.2->1.1.2.2.2.1
114 114
115 115 ---------------------
116 116 PatchSet 6
117 117 Date:
118 118 Author:
119 119 Branch: HEAD
120 120 Tag: (none)
121 121 Parents: 1,5
122 122 Log:
123 123 merge
124 124
125 125 Members:
126 126 foo.txt:1.1->1.2
127 127
128 128 ---------------------
129 129 PatchSet 7
130 130 Date:
131 131 Author:
132 132 Branch: MYBRANCH1_1
133 133 Tag: (none)
134 134 Parents: 4,3
135 135 Log:
136 136 merge
137 137
138 138 Members:
139 139 foo.txt:1.1.4.1->1.1.4.2
140 140
General Comments 0
You need to be logged in to leave comments. Login now