Debian Codegraph @

tests/test-convert-cvs-synthetic.t

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