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