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