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 | |
55 |
|
108 | 7 log entries | ||
56 | echo "% checkout #2: create MYBRANCH1 and modify foo.txt on it" |
|
109 | creating changesets | |
57 | cvscall -Q checkout -d cvswork foo |
|
110 | 7 changeset entries | |
58 |
|
111 | --------------------- | ||
59 | cd cvswork |
|
112 | PatchSet 1 | |
60 |
|
113 | Date: * (glob) | ||
61 | cvscall -q rtag -b -R MYBRANCH1 foo |
|
114 | Author: user | |
62 | cvscall -Q update -P -r MYBRANCH1 |
|
115 | Branch: HEAD | |
63 | echo bar > foo.txt |
|
116 | Tag: (none) | |
64 | cvsci -m "bar" foo.txt |
|
117 | Branchpoints: MYBRANCH1_1, MYBRANCH1 | |
65 | echo baz > foo.txt |
|
118 | Log: | |
66 | cvsci -m "baz" foo.txt |
|
119 | foo.txt | |
67 |
|
120 | |||
68 | echo "% create MYBRANCH1_2 and modify foo.txt some more" |
|
121 | Members: | |
69 | cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo |
|
122 | foo.txt:INITIAL->1.1 | |
70 | cvscall -Q update -P -r MYBRANCH1_2 |
|
123 | ||
71 |
|
124 | --------------------- | ||
72 | echo bazzie > foo.txt |
|
125 | PatchSet 2 | |
73 | cvsci -m "bazzie" foo.txt |
|
126 | Date: * (glob) | |
74 |
|
127 | Author: user | ||
75 | echo "% create MYBRANCH1_1 and modify foo.txt yet again" |
|
128 | Branch: MYBRANCH1 | |
76 | cvscall -q rtag -b -R MYBRANCH1_1 foo |
|
129 | Tag: (none) | |
77 | cvscall -Q update -P -r MYBRANCH1_1 |
|
130 | Parent: 1 | |
78 |
|
131 | Log: | ||
79 | echo quux > foo.txt |
|
132 | bar | |
80 | cvsci -m "quux" foo.txt |
|
133 | ||
81 |
|
134 | Members: | ||
82 | echo "% merge MYBRANCH1 to MYBRANCH1_1" |
|
135 | foo.txt:1.1->1.1.2.1 | |
83 | filterpath cvscall -Q update -P -jMYBRANCH1 |
|
136 | ||
84 | # carefully placed sleep to dodge cvs bug (optimization?) where it |
|
137 | --------------------- | |
85 | # sometimes ignores a "commit" command if it comes too fast (the -f |
|
138 | PatchSet 3 | |
86 | # option in cvsci seems to work for all the other commits in this |
|
139 | Date: * (glob) | |
87 | # script) |
|
140 | Author: user | |
88 | sleep 1 |
|
141 | Branch: MYBRANCH1 | |
89 | echo xyzzy > foo.txt |
|
142 | Tag: (none) | |
90 | cvsci -m "merge1+clobber" foo.txt |
|
143 | Branchpoints: MYBRANCH1_2 | |
91 |
|
144 | Parent: 2 | ||
92 | echo "% return to trunk and merge MYBRANCH1_2" |
|
145 | Log: | |
93 | cvscall -Q update -P -A |
|
146 | baz | |
94 | filterpath cvscall -Q update -P -jMYBRANCH1_2 |
|
147 | ||
95 | cvsci -m "merge2" foo.txt |
|
148 | Members: | |
96 |
|
149 | foo.txt:1.1.2.1->1.1.2.2 | ||
97 | REALCVS=`which cvs` |
|
150 | ||
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 |
|
151 | --------------------- | |
99 | chmod +x ../cvs |
|
152 | PatchSet 4 | |
100 | PATH=..:${PATH} hg debugcvsps --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/' |
|
153 | Date: * (glob) | |
101 |
|
154 | Author: user | ||
102 | cd .. |
|
155 | Branch: MYBRANCH1_1 | |
|
156 | Tag: (none) | |||
|
157 | Parent: 1 | |||
|
158 | Log: | |||
|
159 | quux | |||
|
160 | ||||
|
161 | Members: | |||
|
162 | foo.txt:1.1->1.1.4.1 | |||
|
163 | ||||
|
164 | --------------------- | |||
|
165 | PatchSet 5 | |||
|
166 | Date: * (glob) | |||
|
167 | Author: user | |||
|
168 | Branch: MYBRANCH1_2 | |||
|
169 | Tag: (none) | |||
|
170 | Parent: 3 | |||
|
171 | Log: | |||
|
172 | bazzie | |||
|
173 | ||||
|
174 | Members: | |||
|
175 | foo.txt:1.1.2.2->1.1.2.2.2.1 | |||
|
176 | ||||
|
177 | --------------------- | |||
|
178 | PatchSet 6 | |||
|
179 | Date: * (glob) | |||
|
180 | Author: user | |||
|
181 | Branch: HEAD | |||
|
182 | Tag: (none) | |||
|
183 | Parents: 1,5 | |||
|
184 | Log: | |||
|
185 | merge | |||
|
186 | ||||
|
187 | Members: | |||
|
188 | foo.txt:1.1->1.2 | |||
|
189 | ||||
|
190 | --------------------- | |||
|
191 | PatchSet 7 | |||
|
192 | Date: * (glob) | |||
|
193 | Author: user | |||
|
194 | Branch: MYBRANCH1_1 | |||
|
195 | Tag: (none) | |||
|
196 | Parents: 4,3 | |||
|
197 | Log: | |||
|
198 | merge | |||
|
199 | ||||
|
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