##// END OF EJS Templates
tests: avoid instability in test-convert-cvs-synthetic
Matt Mackall -
r14602:c4f27129 default
parent child Browse files
Show More
@@ -1,216 +1,217 b''
1 1 This feature requires use of builtin cvsps!
2 2
3 3 $ "$TESTDIR/hghave" cvs || exit 80
4 4 $ echo "[extensions]" >> $HGRCPATH
5 5 $ echo "convert = " >> $HGRCPATH
6 6 $ echo "graphlog = " >> $HGRCPATH
7 7
8 8 create cvs repository with one project
9 9
10 10 $ mkdir cvsrepo
11 11 $ cd cvsrepo
12 12 $ CVSROOT=`pwd`
13 13 $ export CVSROOT
14 14 $ CVS_OPTIONS=-f
15 15 $ export CVS_OPTIONS
16 16 $ cd ..
17 17 $ cvscall()
18 18 > {
19 19 > cvs -f "$@"
20 20 > }
21 21
22 22 output of 'cvs ci' varies unpredictably, so just discard it
23 23
24 24 $ cvsci()
25 25 > {
26 > sleep 1
26 27 > cvs -f ci "$@" >/dev/null
27 28 > }
28 29 $ cvscall -d "$CVSROOT" init
29 30 $ mkdir cvsrepo/proj
30 31 $ cvscall -q co proj
31 32
32 33 create file1 on the trunk
33 34
34 35 $ cd proj
35 36 $ touch file1
36 37 $ cvscall -Q add file1
37 38 $ cvsci -m"add file1 on trunk" file1
38 39
39 40 create two branches
40 41
41 42 $ cvscall -q tag -b v1_0
42 43 T file1
43 44 $ cvscall -q tag -b v1_1
44 45 T file1
45 46
46 47 create file2 on branch v1_0
47 48
48 49 $ cvscall -Q up -rv1_0
49 50 $ touch file2
50 51 $ cvscall -Q add file2
51 52 $ cvsci -m"add file2" file2
52 53
53 54 create file3, file4 on branch v1_1
54 55
55 56 $ cvscall -Q up -rv1_1
56 57 $ touch file3
57 58 $ touch file4
58 59 $ cvscall -Q add file3 file4
59 60 $ cvsci -m"add file3, file4 on branch v1_1" file3 file4
60 61
61 62 merge file2 from v1_0 to v1_1
62 63
63 64 $ cvscall -Q up -jv1_0
64 65 $ cvsci -m"MERGE from v1_0: add file2"
65 66 cvs commit: Examining .
66 67
67 68 Step things up a notch: now we make the history really hairy, with
68 69 changes bouncing back and forth between trunk and v1_2 and merges
69 70 going both ways. (I.e., try to model the real world.)
70 71 create branch v1_2
71 72
72 73 $ cvscall -Q up -A
73 74 $ cvscall -q tag -b v1_2
74 75 T file1
75 76
76 77 create file5 on branch v1_2
77 78
78 79 $ cvscall -Q up -rv1_2
79 80 $ touch file5
80 81 $ cvs -Q add file5
81 82 $ cvsci -m"add file5 on v1_2"
82 83 cvs commit: Examining .
83 84
84 85 create file6 on trunk post-v1_2
85 86
86 87 $ cvscall -Q up -A
87 88 $ touch file6
88 89 $ cvscall -Q add file6
89 90 $ cvsci -m"add file6 on trunk post-v1_2"
90 91 cvs commit: Examining .
91 92
92 93 merge file5 from v1_2 to trunk
93 94
94 95 $ cvscall -Q up -A
95 96 $ cvscall -Q up -jv1_2 file5
96 97 $ cvsci -m"MERGE from v1_2: add file5"
97 98 cvs commit: Examining .
98 99
99 100 merge file6 from trunk to v1_2
100 101
101 102 $ cvscall -Q up -rv1_2
102 103 $ cvscall up -jHEAD file6
103 104 U file6
104 105 $ cvsci -m"MERGE from HEAD: add file6"
105 106 cvs commit: Examining .
106 107
107 108 cvs rlog output
108 109
109 110 $ cvscall -q rlog proj | egrep '^(RCS file|revision)'
110 111 RCS file: $TESTTMP/cvsrepo/proj/file1,v
111 112 revision 1.1
112 113 RCS file: $TESTTMP/cvsrepo/proj/Attic/file2,v
113 114 revision 1.1
114 115 revision 1.1.4.2
115 116 revision 1.1.4.1
116 117 revision 1.1.2.1
117 118 RCS file: $TESTTMP/cvsrepo/proj/Attic/file3,v
118 119 revision 1.1
119 120 revision 1.1.2.1
120 121 RCS file: $TESTTMP/cvsrepo/proj/Attic/file4,v
121 122 revision 1.1
122 123 revision 1.1.2.1
123 124 RCS file: $TESTTMP/cvsrepo/proj/file5,v
124 125 revision 1.2
125 126 revision 1.1
126 127 revision 1.1.2.1
127 128 RCS file: $TESTTMP/cvsrepo/proj/file6,v
128 129 revision 1.1
129 130 revision 1.1.2.2
130 131 revision 1.1.2.1
131 132
132 133 convert to hg (#1)
133 134
134 135 $ cd ..
135 136 $ hg convert --datesort proj proj.hg
136 137 initializing destination proj.hg repository
137 138 connecting to $TESTTMP/cvsrepo
138 139 scanning source...
139 140 collecting CVS rlog
140 141 15 log entries
141 142 creating changesets
142 143 8 changeset entries
143 144 sorting...
144 145 converting...
145 146 7 add file1 on trunk
146 147 6 add file2
147 148 5 add file3, file4 on branch v1_1
148 149 4 MERGE from v1_0: add file2
149 150 3 add file5 on v1_2
150 151 2 add file6 on trunk post-v1_2
151 152 1 MERGE from v1_2: add file5
152 153 0 MERGE from HEAD: add file6
153 154
154 155 hg glog output (#1)
155 156
156 157 $ hg -R proj.hg glog --template "{rev} {desc}\n"
157 158 o 7 MERGE from HEAD: add file6
158 159 |
159 160 | o 6 MERGE from v1_2: add file5
160 161 | |
161 162 | o 5 add file6 on trunk post-v1_2
162 163 | |
163 164 o | 4 add file5 on v1_2
164 165 |/
165 166 | o 3 MERGE from v1_0: add file2
166 167 | |
167 168 | o 2 add file3, file4 on branch v1_1
168 169 |/
169 170 | o 1 add file2
170 171 |/
171 172 o 0 add file1 on trunk
172 173
173 174
174 175 convert to hg (#2: with merge detection)
175 176
176 177 $ hg convert \
177 178 > --config convert.cvsps.mergefrom='"^MERGE from (\S+):"' \
178 179 > --datesort \
179 180 > proj proj.hg2
180 181 initializing destination proj.hg2 repository
181 182 connecting to $TESTTMP/cvsrepo
182 183 scanning source...
183 184 collecting CVS rlog
184 185 15 log entries
185 186 creating changesets
186 187 8 changeset entries
187 188 sorting...
188 189 converting...
189 190 7 add file1 on trunk
190 191 6 add file2
191 192 5 add file3, file4 on branch v1_1
192 193 4 MERGE from v1_0: add file2
193 194 3 add file5 on v1_2
194 195 2 add file6 on trunk post-v1_2
195 196 1 MERGE from v1_2: add file5
196 197 0 MERGE from HEAD: add file6
197 198
198 199 hg glog output (#2)
199 200
200 201 $ hg -R proj.hg2 glog --template "{rev} {desc}\n"
201 202 o 7 MERGE from HEAD: add file6
202 203 |
203 204 | o 6 MERGE from v1_2: add file5
204 205 | |
205 206 | o 5 add file6 on trunk post-v1_2
206 207 | |
207 208 o | 4 add file5 on v1_2
208 209 |/
209 210 | o 3 MERGE from v1_0: add file2
210 211 | |
211 212 | o 2 add file3, file4 on branch v1_1
212 213 |/
213 214 | o 1 add file2
214 215 |/
215 216 o 0 add file1 on trunk
216 217
General Comments 0
You need to be logged in to leave comments. Login now