Show More
@@ -1,232 +1,233 | |||
|
1 | 1 | Test config convert.cvsps.mergefrom config setting. |
|
2 | 2 | (Should test similar mergeto feature, but I don't understand it yet.) |
|
3 | 3 | Requires builtin cvsps. |
|
4 | 4 | |
|
5 | 5 | $ "$TESTDIR/hghave" cvs || exit 80 |
|
6 | 6 | $ CVSROOT=`pwd`/cvsrepo |
|
7 | 7 | $ export CVSROOT |
|
8 | 8 | |
|
9 | 9 | $ cvscall() |
|
10 | 10 | > { |
|
11 | 11 | > cvs -f "$@" |
|
12 | 12 | > } |
|
13 | 13 | |
|
14 | 14 | output of 'cvs ci' varies unpredictably, so just discard it |
|
15 | 15 | XXX copied from test-convert-cvs-synthetic |
|
16 | 16 | |
|
17 | 17 | $ cvsci() |
|
18 | 18 | > { |
|
19 | 19 | > sleep 1 |
|
20 | 20 | > cvs -f ci "$@" > /dev/null |
|
21 | 21 | > } |
|
22 | 22 | |
|
23 | 23 | XXX copied from test-convert-cvs-synthetic |
|
24 | 24 | |
|
25 | 25 | $ echo "[extensions]" >> $HGRCPATH |
|
26 | 26 | $ echo "convert = " >> $HGRCPATH |
|
27 | 27 | $ echo "graphlog = " >> $HGRCPATH |
|
28 | 28 | $ echo "[convert]" >> $HGRCPATH |
|
29 | 29 | $ echo "cvsps.cache=0" >> $HGRCPATH |
|
30 | 30 | $ echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH |
|
31 | 31 | |
|
32 | 32 | create cvs repository with one project |
|
33 | 33 | |
|
34 | 34 | $ mkdir cvsrepo |
|
35 | 35 | $ cvscall -q -d "$CVSROOT" init |
|
36 | 36 | $ mkdir cvsrepo/proj |
|
37 | 37 | |
|
38 | 38 | populate cvs repository |
|
39 | 39 | |
|
40 | 40 | $ cvscall -Q co proj |
|
41 | 41 | $ cd proj |
|
42 | 42 | $ touch file1 |
|
43 | 43 | $ cvscall -Q add file1 |
|
44 | 44 | $ cvsci -m"add file1 on trunk" |
|
45 | 45 | cvs commit: Examining . |
|
46 | 46 | |
|
47 | 47 | create two release branches |
|
48 | 48 | |
|
49 | 49 | $ cvscall -q tag -b v1_0 |
|
50 | 50 | T file1 |
|
51 | 51 | $ cvscall -q tag -b v1_1 |
|
52 | 52 | T file1 |
|
53 | 53 | |
|
54 | 54 | modify file1 on branch v1_0 |
|
55 | 55 | |
|
56 | 56 | $ cvscall -Q update -rv1_0 |
|
57 | $ sleep 1 | |
|
57 | 58 | $ echo "change" >> file1 |
|
58 | 59 | $ cvsci -m"add text" |
|
59 | 60 | cvs commit: Examining . |
|
60 | 61 | |
|
61 | 62 | make unrelated change on v1_1 |
|
62 | 63 | |
|
63 | 64 | $ cvscall -Q update -rv1_1 |
|
64 | 65 | $ touch unrelated |
|
65 | 66 | $ cvscall -Q add unrelated |
|
66 | 67 | $ cvsci -m"unrelated change" |
|
67 | 68 | cvs commit: Examining . |
|
68 | 69 | |
|
69 | 70 | merge file1 to v1_1 |
|
70 | 71 | |
|
71 | 72 | $ cvscall -Q update -jv1_0 |
|
72 | 73 | RCS file: $TESTTMP/cvsrepo/proj/file1,v |
|
73 | 74 | retrieving revision 1.1 |
|
74 | 75 | retrieving revision 1.1.2.1 |
|
75 | 76 | Merging differences between 1.1 and 1.1.2.1 into file1 |
|
76 | 77 | $ cvsci -m"add text [MERGE from v1_0]" |
|
77 | 78 | cvs commit: Examining . |
|
78 | 79 | |
|
79 | 80 | merge change to trunk |
|
80 | 81 | |
|
81 | 82 | $ cvscall -Q update -A |
|
82 | 83 | $ cvscall -Q update -jv1_1 |
|
83 | 84 | RCS file: $TESTTMP/cvsrepo/proj/file1,v |
|
84 | 85 | retrieving revision 1.1 |
|
85 | 86 | retrieving revision 1.1.4.1 |
|
86 | 87 | Merging differences between 1.1 and 1.1.4.1 into file1 |
|
87 | 88 | $ cvsci -m"add text [MERGE from v1_1]" |
|
88 | 89 | cvs commit: Examining . |
|
89 | 90 | |
|
90 | 91 | non-merged change on trunk |
|
91 | 92 | |
|
92 | 93 | $ echo "foo" > file2 |
|
93 | 94 | $ cvscall -Q add file2 |
|
94 | 95 | $ cvsci -m"add file2 on trunk" file2 |
|
95 | 96 | |
|
96 | 97 | this will create rev 1.3 |
|
97 | 98 | change on trunk to backport |
|
98 | 99 | |
|
99 | 100 | $ echo "backport me" >> file1 |
|
100 | 101 | $ cvsci -m"add other text" file1 |
|
101 | 102 | $ cvscall log file1 |
|
102 | 103 | |
|
103 | 104 | RCS file: $TESTTMP/cvsrepo/proj/file1,v |
|
104 | 105 | Working file: file1 |
|
105 | 106 | head: 1.3 |
|
106 | 107 | branch: |
|
107 | 108 | locks: strict |
|
108 | 109 | access list: |
|
109 | 110 | symbolic names: |
|
110 | 111 | v1_1: 1.1.0.4 |
|
111 | 112 | v1_0: 1.1.0.2 |
|
112 | 113 | keyword substitution: kv |
|
113 | 114 | total revisions: 5; selected revisions: 5 |
|
114 | 115 | description: |
|
115 | 116 | ---------------------------- |
|
116 | 117 | revision 1.3 |
|
117 | 118 | date: * (glob) |
|
118 | 119 | add other text |
|
119 | 120 | ---------------------------- |
|
120 | 121 | revision 1.2 |
|
121 | 122 | date: * (glob) |
|
122 | 123 | add text [MERGE from v1_1] |
|
123 | 124 | ---------------------------- |
|
124 | 125 | revision 1.1 |
|
125 | 126 | date: * (glob) |
|
126 | 127 | branches: 1.1.2; 1.1.4; |
|
127 | 128 | add file1 on trunk |
|
128 | 129 | ---------------------------- |
|
129 | 130 | revision 1.1.4.1 |
|
130 | 131 | date: * (glob) |
|
131 | 132 | add text [MERGE from v1_0] |
|
132 | 133 | ---------------------------- |
|
133 | 134 | revision 1.1.2.1 |
|
134 | 135 | date: * (glob) |
|
135 | 136 | add text |
|
136 | 137 | ============================================================================= |
|
137 | 138 | |
|
138 | 139 | XXX how many ways are there to spell "trunk" with CVS? |
|
139 | 140 | backport trunk change to v1_1 |
|
140 | 141 | |
|
141 | 142 | $ cvscall -Q update -rv1_1 |
|
142 | 143 | $ cvscall -Q update -j1.2 -j1.3 file1 |
|
143 | 144 | RCS file: $TESTTMP/cvsrepo/proj/file1,v |
|
144 | 145 | retrieving revision 1.2 |
|
145 | 146 | retrieving revision 1.3 |
|
146 | 147 | Merging differences between 1.2 and 1.3 into file1 |
|
147 | 148 | $ cvsci -m"add other text [MERGE from HEAD]" file1 |
|
148 | 149 | |
|
149 | 150 | fix bug on v1_1, merge to trunk with error |
|
150 | 151 | |
|
151 | 152 | $ cvscall -Q update -rv1_1 |
|
152 | 153 | $ echo "merge forward" >> file1 |
|
153 | 154 | $ cvscall -Q tag unmerged |
|
154 | 155 | $ cvsci -m"fix file1" |
|
155 | 156 | cvs commit: Examining . |
|
156 | 157 | $ cvscall -Q update -A |
|
157 | 158 | $ cvscall -Q update -junmerged -jv1_1 |
|
158 | 159 | RCS file: $TESTTMP/cvsrepo/proj/file1,v |
|
159 | 160 | retrieving revision 1.1.4.2 |
|
160 | 161 | retrieving revision 1.1.4.3 |
|
161 | 162 | Merging differences between 1.1.4.2 and 1.1.4.3 into file1 |
|
162 | 163 | |
|
163 | 164 | note the typo in the commit log message |
|
164 | 165 | |
|
165 | 166 | $ cvsci -m"fix file1 [MERGE from v1-1]" |
|
166 | 167 | cvs commit: Examining . |
|
167 | 168 | $ cvs -Q tag -d unmerged |
|
168 | 169 | |
|
169 | 170 | convert to hg |
|
170 | 171 | |
|
171 | 172 | $ cd .. |
|
172 | 173 | $ hg convert proj proj.hg |
|
173 | 174 | initializing destination proj.hg repository |
|
174 | 175 | connecting to $TESTTMP/cvsrepo |
|
175 | 176 | scanning source... |
|
176 | 177 | collecting CVS rlog |
|
177 | 178 | 12 log entries |
|
178 | 179 | creating changesets |
|
179 | 180 | warning: CVS commit message references non-existent branch 'v1-1': |
|
180 | 181 | fix file1 [MERGE from v1-1] |
|
181 | 182 | 10 changeset entries |
|
182 | 183 | sorting... |
|
183 | 184 | converting... |
|
184 | 185 | 9 add file1 on trunk |
|
185 | 186 | 8 add text |
|
186 | 187 | 7 unrelated change |
|
187 | 188 | 6 add text [MERGE from v1_0] |
|
188 | 189 | 5 add text [MERGE from v1_1] |
|
189 | 190 | 4 add file2 on trunk |
|
190 | 191 | 3 add other text |
|
191 | 192 | 2 add other text [MERGE from HEAD] |
|
192 | 193 | 1 fix file1 |
|
193 | 194 | 0 fix file1 [MERGE from v1-1] |
|
194 | 195 | |
|
195 | 196 | complete log |
|
196 | 197 | |
|
197 | 198 | $ template="{rev}: '{branches}' {desc}\n" |
|
198 | 199 | $ hg -R proj.hg log --template="$template" |
|
199 | 200 | 9: '' fix file1 [MERGE from v1-1] |
|
200 | 201 | 8: 'v1_1' fix file1 |
|
201 | 202 | 7: 'v1_1' add other text [MERGE from HEAD] |
|
202 | 203 | 6: '' add other text |
|
203 | 204 | 5: '' add file2 on trunk |
|
204 | 205 | 4: '' add text [MERGE from v1_1] |
|
205 | 206 | 3: 'v1_1' add text [MERGE from v1_0] |
|
206 | 207 | 2: 'v1_1' unrelated change |
|
207 | 208 | 1: 'v1_0' add text |
|
208 | 209 | 0: '' add file1 on trunk |
|
209 | 210 | |
|
210 | 211 | graphical log |
|
211 | 212 | |
|
212 | 213 | $ hg -R proj.hg glog --template="$template" |
|
213 | 214 | o 9: '' fix file1 [MERGE from v1-1] |
|
214 | 215 | | |
|
215 | 216 | | o 8: 'v1_1' fix file1 |
|
216 | 217 | | | |
|
217 | 218 | | o 7: 'v1_1' add other text [MERGE from HEAD] |
|
218 | 219 | |/| |
|
219 | 220 | o | 6: '' add other text |
|
220 | 221 | | | |
|
221 | 222 | o | 5: '' add file2 on trunk |
|
222 | 223 | | | |
|
223 | 224 | o | 4: '' add text [MERGE from v1_1] |
|
224 | 225 | |\| |
|
225 | 226 | | o 3: 'v1_1' add text [MERGE from v1_0] |
|
226 | 227 | | |\ |
|
227 | 228 | +---o 2: 'v1_1' unrelated change |
|
228 | 229 | | | |
|
229 | 230 | | o 1: 'v1_0' add text |
|
230 | 231 | |/ |
|
231 | 232 | o 0: '' add file1 on trunk |
|
232 | 233 |
General Comments 0
You need to be logged in to leave comments.
Login now