| 1 |
#require cvs no-root |
| 2 |
|
| 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 |
| 14 |
|
| 15 |
$ cvsci() |
| 16 |
> { |
| 17 |
> cvs -f ci -f "$@" > /dev/null |
| 18 |
> } |
| 19 |
$ hgcat() |
| 20 |
> { |
| 21 |
> hg --cwd src-hg cat -r tip "$1" |
| 22 |
> } |
| 23 |
$ echo "[extensions]" >> $HGRCPATH |
| 24 |
$ echo "convert = " >> $HGRCPATH |
| 25 |
|
| 26 |
create cvs repository |
| 27 |
|
| 28 |
$ mkdir cvsmaster |
| 29 |
$ cd cvsmaster |
| 30 |
$ CVSROOT=`pwd` |
| 31 |
$ export CVSROOT |
| 32 |
$ CVS_OPTIONS=-f |
| 33 |
$ export CVS_OPTIONS |
| 34 |
$ cd .. |
| 35 |
$ rmdir cvsmaster |
| 36 |
$ filterpath cvscall -Q -d "$CVSROOT" init |
| 37 |
|
| 38 |
checkout #1: add foo.txt |
| 39 |
|
| 40 |
$ cvscall -Q checkout -d cvsworktmp . |
| 41 |
$ cd cvsworktmp |
| 42 |
$ mkdir foo |
| 43 |
$ cvscall -Q add foo |
| 44 |
$ cd foo |
| 45 |
$ echo foo > foo.txt |
| 46 |
$ cvscall -Q add foo.txt |
| 47 |
$ cvsci -m "add foo.txt" foo.txt |
| 48 |
$ cd ../.. |
| 49 |
$ rm -rf cvsworktmp |
| 50 |
|
| 51 |
checkout #2: create MYBRANCH1 and modify foo.txt on it |
| 52 |
|
| 53 |
$ cvscall -Q checkout -d cvswork foo |
| 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 |
| 63 |
|
| 64 |
$ cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo |
| 65 |
$ cvscall -Q update -P -r MYBRANCH1_2 |
| 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 |
| 77 |
|
| 78 |
$ filterpath cvscall -Q update -P -jMYBRANCH1 |
| 79 |
rcsmerge: warning: conflicts during merge |
| 80 |
RCS file: *REPO*/foo/foo.txt,v |
| 81 |
retrieving revision 1.1 |
| 82 |
retrieving revision 1.1.2.2 |
| 83 |
Merging differences between 1.1 and 1.1.2.2 into foo.txt |
| 84 |
|
| 85 |
carefully placed sleep to dodge cvs bug (optimization?) where it |
| 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 |
#if unix-permissions |
| 95 |
|
| 96 |
return to trunk and merge MYBRANCH1_2 |
| 97 |
|
| 98 |
$ cvscall -Q update -P -A |
| 99 |
$ filterpath cvscall -Q update -P -jMYBRANCH1_2 |
| 100 |
RCS file: *REPO*/foo/foo.txt,v |
| 101 |
retrieving revision 1.1 |
| 102 |
retrieving revision 1.1.2.2.2.1 |
| 103 |
Merging differences between 1.1 and 1.1.2.2.2.1 into foo.txt |
| 104 |
$ cvsci -m "merge2" foo.txt |
| 105 |
$ REALCVS=`which cvs` |
| 106 |
$ 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 |
| 107 |
$ chmod +x ../cvs |
| 108 |
$ PATH=..:${PATH} hg debugcvsps --parents foo |
| 109 |
collecting CVS rlog |
| 110 |
7 log entries |
| 111 |
creating changesets |
| 112 |
7 changeset entries |
| 113 |
--------------------- |
| 114 |
PatchSet 1 |
| 115 |
Date: * (glob) |
| 116 |
Author: user |
| 117 |
Branch: HEAD |
| 118 |
Tag: (none) |
| 119 |
Branchpoints: MYBRANCH1, MYBRANCH1_1 |
| 120 |
Log: |
| 121 |
foo.txt |
| 122 |
|
| 123 |
Members: |
| 124 |
foo.txt:INITIAL->1.1 |
| 125 |
|
| 126 |
--------------------- |
| 127 |
PatchSet 2 |
| 128 |
Date: * (glob) |
| 129 |
Author: user |
| 130 |
Branch: MYBRANCH1 |
| 131 |
Tag: (none) |
| 132 |
Parent: 1 |
| 133 |
Log: |
| 134 |
bar |
| 135 |
|
| 136 |
Members: |
| 137 |
foo.txt:1.1->1.1.2.1 |
| 138 |
|
| 139 |
--------------------- |
| 140 |
PatchSet 3 |
| 141 |
Date: * (glob) |
| 142 |
Author: user |
| 143 |
Branch: MYBRANCH1 |
| 144 |
Tag: (none) |
| 145 |
Branchpoints: MYBRANCH1_2 |
| 146 |
Parent: 2 |
| 147 |
Log: |
| 148 |
baz |
| 149 |
|
| 150 |
Members: |
| 151 |
foo.txt:1.1.2.1->1.1.2.2 |
| 152 |
|
| 153 |
--------------------- |
| 154 |
PatchSet 4 |
| 155 |
Date: * (glob) |
| 156 |
Author: user |
| 157 |
Branch: MYBRANCH1_1 |
| 158 |
Tag: (none) |
| 159 |
Parent: 1 |
| 160 |
Log: |
| 161 |
quux |
| 162 |
|
| 163 |
Members: |
| 164 |
foo.txt:1.1->1.1.4.1 |
| 165 |
|
| 166 |
--------------------- |
| 167 |
PatchSet 5 |
| 168 |
Date: * (glob) |
| 169 |
Author: user |
| 170 |
Branch: MYBRANCH1_2 |
| 171 |
Tag: (none) |
| 172 |
Parent: 3 |
| 173 |
Log: |
| 174 |
bazzie |
| 175 |
|
| 176 |
Members: |
| 177 |
foo.txt:1.1.2.2->1.1.2.2.2.1 |
| 178 |
|
| 179 |
--------------------- |
| 180 |
PatchSet 6 |
| 181 |
Date: * (glob) |
| 182 |
Author: user |
| 183 |
Branch: HEAD |
| 184 |
Tag: (none) |
| 185 |
Parents: 1,5 |
| 186 |
Log: |
| 187 |
merge |
| 188 |
|
| 189 |
Members: |
| 190 |
foo.txt:1.1->1.2 |
| 191 |
|
| 192 |
--------------------- |
| 193 |
PatchSet 7 |
| 194 |
Date: * (glob) |
| 195 |
Author: user |
| 196 |
Branch: MYBRANCH1_1 |
| 197 |
Tag: (none) |
| 198 |
Parents: 4,3 |
| 199 |
Log: |
| 200 |
merge |
| 201 |
|
| 202 |
Members: |
| 203 |
foo.txt:1.1.4.1->1.1.4.2 |
| 204 |
|
| 205 |
#endif |
| 206 |
|
| 207 |
$ cd .. |