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