Show More
@@ -1,102 +1,202 | |||||
1 | #!/bin/sh |
|
|||
2 |
|
1 | |||
3 | "$TESTDIR/hghave" cvs || exit 80 |
|
2 | $ "$TESTDIR/hghave" cvs || exit 80 | |
|
3 | $ filterpath() | |||
|
4 | > { | |||
|
5 | > eval "$@" | sed "s:$CVSROOT:*REPO*:g" | |||
|
6 | > } | |||
|
7 | $ cvscall() | |||
|
8 | > { | |||
|
9 | > cvs -f "$@" | |||
|
10 | > } | |||
|
11 | ||||
|
12 | output of 'cvs ci' varies unpredictably, so discard most of it | |||
|
13 | -- just keep the part that matters | |||
4 |
|
14 | |||
5 | filterpath() |
|
15 | $ cvsci() | |
6 | { |
|
16 | > { | |
7 | eval "$@" | sed "s:$CVSROOT:*REPO*:g" |
|
17 | > cvs -f ci -f "$@" > /dev/null | |
8 | } |
|
18 | > } | |
|
19 | $ hgcat() | |||
|
20 | > { | |||
|
21 | > hg --cwd src-hg cat -r tip "$1" | |||
|
22 | > } | |||
|
23 | $ echo "[extensions]" >> $HGRCPATH | |||
|
24 | $ echo "convert = " >> $HGRCPATH | |||
|
25 | $ echo "graphlog = " >> $HGRCPATH | |||
9 |
|
26 | |||
10 | cvscall() |
|
27 | create cvs repository | |
11 | { |
|
28 | ||
12 | echo cvs -f "$@" |
|
29 | $ mkdir cvsmaster | |
13 | cvs -f "$@" |
|
30 | $ cd cvsmaster | |
14 | } |
|
31 | $ CVSROOT=`pwd` | |
|
32 | $ export CVSROOT | |||
|
33 | $ CVS_OPTIONS=-f | |||
|
34 | $ export CVS_OPTIONS | |||
|
35 | $ cd .. | |||
|
36 | $ filterpath cvscall -Q -d "$CVSROOT" init | |||
|
37 | ||||
|
38 | checkout #1: add foo.txt | |||
15 |
|
39 | |||
16 | # output of 'cvs ci' varies unpredictably, so discard most of it |
|
40 | $ cvscall -Q checkout -d cvsworktmp . | |
17 | # -- just keep the part that matters |
|
41 | $ cd cvsworktmp | |
18 | cvsci() |
|
42 | $ mkdir foo | |
19 | { |
|
43 | $ cvscall -Q add foo | |
20 | echo cvs -f ci -f "$@" |
|
44 | $ cd foo | |
21 | cvs -f ci -f "$@" 2>&1 | egrep "^(new|initial) revision:" |
|
45 | $ echo foo > foo.txt | |
22 | } |
|
46 | $ cvscall -Q add foo.txt | |
|
47 | $ cvsci -m "add foo.txt" foo.txt | |||
|
48 | $ cd ../.. | |||
|
49 | $ rm -rf cvsworktmp | |||
23 |
|
50 | |||
24 | hgcat() |
|
51 | checkout #2: create MYBRANCH1 and modify foo.txt on it | |
25 | { |
|
52 | ||
26 | hg --cwd src-hg cat -r tip "$1" |
|
53 | $ cvscall -Q checkout -d cvswork foo | |
27 | } |
|
54 | $ cd cvswork | |
|
55 | $ cvscall -q rtag -b -R MYBRANCH1 foo | |||
|
56 | $ cvscall -Q update -P -r MYBRANCH1 | |||
|
57 | $ echo bar > foo.txt | |||
|
58 | $ cvsci -m "bar" foo.txt | |||
|
59 | $ echo baz > foo.txt | |||
|
60 | $ cvsci -m "baz" foo.txt | |||
|
61 | ||||
|
62 | create MYBRANCH1_2 and modify foo.txt some more | |||
28 |
|
63 | |||
29 | echo "[extensions]" >> $HGRCPATH |
|
64 | $ cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo | |
30 | echo "convert = " >> $HGRCPATH |
|
65 | $ cvscall -Q update -P -r MYBRANCH1_2 | |
31 | echo "graphlog = " >> $HGRCPATH |
|
66 | $ echo bazzie > foo.txt | |
|
67 | $ cvsci -m "bazzie" foo.txt | |||
|
68 | ||||
|
69 | create MYBRANCH1_1 and modify foo.txt yet again | |||
|
70 | ||||
|
71 | $ cvscall -q rtag -b -R MYBRANCH1_1 foo | |||
|
72 | $ cvscall -Q update -P -r MYBRANCH1_1 | |||
|
73 | $ echo quux > foo.txt | |||
|
74 | $ cvsci -m "quux" foo.txt | |||
|
75 | ||||
|
76 | merge MYBRANCH1 to MYBRANCH1_1 | |||
32 |
|
77 | |||
33 | echo "% create cvs repository" |
|
78 | $ filterpath cvscall -Q update -P -jMYBRANCH1 | |
34 | mkdir cvsmaster |
|
79 | rcsmerge: warning: conflicts during merge | |
35 | cd cvsmaster |
|
80 | RCS file: *REPO*/foo/foo.txt,v | |
36 | CVSROOT=`pwd` |
|
81 | retrieving revision 1.1 | |
37 | export CVSROOT |
|
82 | retrieving revision 1.1.2.2 | |
38 | CVS_OPTIONS=-f |
|
83 | Merging differences between 1.1 and 1.1.2.2 into foo.txt | |
39 | export CVS_OPTIONS |
|
84 | ||
40 | cd .. |
|
85 | carefully placed sleep to dodge cvs bug (optimization?) where it | |
41 | filterpath cvscall -Q -d "$CVSROOT" init |
|
86 | sometimes ignores a "commit" command if it comes too fast (the -f | |
|
87 | option in cvsci seems to work for all the other commits in this | |||
|
88 | script) | |||
|
89 | ||||
|
90 | $ sleep 1 | |||
|
91 | $ echo xyzzy > foo.txt | |||
|
92 | $ cvsci -m "merge1+clobber" foo.txt | |||
|
93 | ||||
|
94 | return to trunk and merge MYBRANCH1_2 | |||
42 |
|
95 | |||
43 | echo "% checkout #1: add foo.txt" |
|
96 | $ cvscall -Q update -P -A | |
44 | cvscall -Q checkout -d cvsworktmp . |
|
97 | $ filterpath cvscall -Q update -P -jMYBRANCH1_2 | |
45 | cd cvsworktmp |
|
98 | RCS file: *REPO*/foo/foo.txt,v | |
46 | mkdir foo |
|
99 | retrieving revision 1.1 | |
47 | cvscall -Q add foo |
|
100 | retrieving revision 1.1.2.2.2.1 | |
48 | cd foo |
|
101 | Merging differences between 1.1 and 1.1.2.2.2.1 into foo.txt | |
49 | echo foo > foo.txt |
|
102 | $ cvsci -m "merge2" foo.txt | |
50 | cvscall -Q add foo.txt |
|
103 | $ REALCVS=`which cvs` | |
51 | cvsci -m "add foo.txt" foo.txt |
|
104 | $ echo "for x in \$*; do if [ \"\$x\" = \"rlog\" ]; then echo \"RCS file: $CVSROOT/foo/foo.txt,v\"; cat $TESTDIR/test-convert-cvsnt-mergepoints.rlog; exit 0; fi; done; $REALCVS \$*" > ../cvs | |
52 |
|
105 | $ chmod +x ../cvs | ||
53 | cd ../.. |
|
106 | $ PATH=..:${PATH} hg debugcvsps --parents foo | |
54 | rm -rf cvsworktmp |
|
107 | collecting CVS rlog | |
|
108 | 7 log entries | |||
|
109 | creating changesets | |||
|
110 | 7 changeset entries | |||
|
111 | --------------------- | |||
|
112 | PatchSet 1 | |||
|
113 | Date: * (glob) | |||
|
114 | Author: user | |||
|
115 | Branch: HEAD | |||
|
116 | Tag: (none) | |||
|
117 | Branchpoints: MYBRANCH1_1, MYBRANCH1 | |||
|
118 | Log: | |||
|
119 | foo.txt | |||
55 |
|
120 | |||
56 | echo "% checkout #2: create MYBRANCH1 and modify foo.txt on it" |
|
121 | Members: | |
57 | cvscall -Q checkout -d cvswork foo |
|
122 | foo.txt:INITIAL->1.1 | |
58 |
|
123 | |||
59 | cd cvswork |
|
124 | --------------------- | |
|
125 | PatchSet 2 | |||
|
126 | Date: * (glob) | |||
|
127 | Author: user | |||
|
128 | Branch: MYBRANCH1 | |||
|
129 | Tag: (none) | |||
|
130 | Parent: 1 | |||
|
131 | Log: | |||
|
132 | bar | |||
60 |
|
133 | |||
61 | cvscall -q rtag -b -R MYBRANCH1 foo |
|
134 | Members: | |
62 | cvscall -Q update -P -r MYBRANCH1 |
|
135 | foo.txt:1.1->1.1.2.1 | |
63 | echo bar > foo.txt |
|
|||
64 | cvsci -m "bar" foo.txt |
|
|||
65 | echo baz > foo.txt |
|
|||
66 | cvsci -m "baz" foo.txt |
|
|||
67 |
|
136 | |||
68 | echo "% create MYBRANCH1_2 and modify foo.txt some more" |
|
137 | --------------------- | |
69 | cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo |
|
138 | PatchSet 3 | |
70 | cvscall -Q update -P -r MYBRANCH1_2 |
|
139 | Date: * (glob) | |
|
140 | Author: user | |||
|
141 | Branch: MYBRANCH1 | |||
|
142 | Tag: (none) | |||
|
143 | Branchpoints: MYBRANCH1_2 | |||
|
144 | Parent: 2 | |||
|
145 | Log: | |||
|
146 | baz | |||
71 |
|
147 | |||
72 | echo bazzie > foo.txt |
|
148 | Members: | |
73 | cvsci -m "bazzie" foo.txt |
|
149 | foo.txt:1.1.2.1->1.1.2.2 | |
|
150 | ||||
|
151 | --------------------- | |||
|
152 | PatchSet 4 | |||
|
153 | Date: * (glob) | |||
|
154 | Author: user | |||
|
155 | Branch: MYBRANCH1_1 | |||
|
156 | Tag: (none) | |||
|
157 | Parent: 1 | |||
|
158 | Log: | |||
|
159 | quux | |||
74 |
|
160 | |||
75 | echo "% create MYBRANCH1_1 and modify foo.txt yet again" |
|
161 | Members: | |
76 | cvscall -q rtag -b -R MYBRANCH1_1 foo |
|
162 | foo.txt:1.1->1.1.4.1 | |
77 | cvscall -Q update -P -r MYBRANCH1_1 |
|
|||
78 |
|
163 | |||
79 | echo quux > foo.txt |
|
164 | --------------------- | |
80 | cvsci -m "quux" foo.txt |
|
165 | PatchSet 5 | |
|
166 | Date: * (glob) | |||
|
167 | Author: user | |||
|
168 | Branch: MYBRANCH1_2 | |||
|
169 | Tag: (none) | |||
|
170 | Parent: 3 | |||
|
171 | Log: | |||
|
172 | bazzie | |||
81 |
|
173 | |||
82 | echo "% merge MYBRANCH1 to MYBRANCH1_1" |
|
174 | Members: | |
83 | filterpath cvscall -Q update -P -jMYBRANCH1 |
|
175 | foo.txt:1.1.2.2->1.1.2.2.2.1 | |
84 | # carefully placed sleep to dodge cvs bug (optimization?) where it |
|
176 | ||
85 | # sometimes ignores a "commit" command if it comes too fast (the -f |
|
177 | --------------------- | |
86 | # option in cvsci seems to work for all the other commits in this |
|
178 | PatchSet 6 | |
87 | # script) |
|
179 | Date: * (glob) | |
88 | sleep 1 |
|
180 | Author: user | |
89 | echo xyzzy > foo.txt |
|
181 | Branch: HEAD | |
90 | cvsci -m "merge1+clobber" foo.txt |
|
182 | Tag: (none) | |
|
183 | Parents: 1,5 | |||
|
184 | Log: | |||
|
185 | merge | |||
91 |
|
186 | |||
92 | echo "% return to trunk and merge MYBRANCH1_2" |
|
187 | Members: | |
93 | cvscall -Q update -P -A |
|
188 | foo.txt:1.1->1.2 | |
94 | filterpath cvscall -Q update -P -jMYBRANCH1_2 |
|
|||
95 | cvsci -m "merge2" foo.txt |
|
|||
96 |
|
189 | |||
97 | REALCVS=`which cvs` |
|
190 | --------------------- | |
98 | echo "for x in \$*; do if [ \"\$x\" = \"rlog\" ]; then echo \"RCS file: $CVSROOT/foo/foo.txt,v\"; cat $TESTDIR/test-convert-cvsnt-mergepoints.rlog; exit 0; fi; done; $REALCVS \$*" > ../cvs |
|
191 | PatchSet 7 | |
99 | chmod +x ../cvs |
|
192 | Date: * (glob) | |
100 | PATH=..:${PATH} hg debugcvsps --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/' |
|
193 | Author: user | |
|
194 | Branch: MYBRANCH1_1 | |||
|
195 | Tag: (none) | |||
|
196 | Parents: 4,3 | |||
|
197 | Log: | |||
|
198 | merge | |||
101 |
|
199 | |||
102 | cd .. |
|
200 | Members: | |
|
201 | foo.txt:1.1.4.1->1.1.4.2 | |||
|
202 |
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