test-convert-cvsnt-mergepoints
102 lines
| 2.3 KiB
| text/plain
|
TextLexer
/ tests / test-convert-cvsnt-mergepoints
Greg Ward
|
r8818 | #!/bin/sh | ||
"$TESTDIR/hghave" cvs || exit 80 | ||||
Greg Ward
|
r8819 | filterpath() | ||
{ | ||||
eval "$@" | sed "s:$CVSROOT:*REPO*:g" | ||||
} | ||||
Greg Ward
|
r8818 | cvscall() | ||
{ | ||||
Greg Ward
|
r8819 | echo cvs -f "$@" | ||
Greg Ward
|
r8818 | cvs -f "$@" | ||
} | ||||
Greg Ward
|
r8819 | # output of 'cvs ci' varies unpredictably, so discard most of it | ||
# -- just keep the part that matters | ||||
cvsci() | ||||
{ | ||||
Greg Ward
|
r8821 | echo cvs -f ci -f "$@" | ||
cvs -f ci -f "$@" 2>&1 | egrep "^(new|initial) revision:" | ||||
Greg Ward
|
r8819 | } | ||
Greg Ward
|
r8818 | hgcat() | ||
{ | ||||
hg --cwd src-hg cat -r tip "$1" | ||||
} | ||||
echo "[extensions]" >> $HGRCPATH | ||||
echo "convert = " >> $HGRCPATH | ||||
echo "graphlog = " >> $HGRCPATH | ||||
Greg Ward
|
r8819 | echo "% create cvs repository" | ||
Greg Ward
|
r8818 | mkdir cvsmaster | ||
cd cvsmaster | ||||
CVSROOT=`pwd` | ||||
export CVSROOT | ||||
CVS_OPTIONS=-f | ||||
export CVS_OPTIONS | ||||
cd .. | ||||
Greg Ward
|
r8819 | filterpath cvscall -Q -d "$CVSROOT" init | ||
Greg Ward
|
r8818 | |||
Greg Ward
|
r8819 | echo "% checkout #1: add foo.txt" | ||
cvscall -Q checkout -d cvsworktmp . | ||||
Greg Ward
|
r8818 | cd cvsworktmp | ||
mkdir foo | ||||
Greg Ward
|
r8819 | cvscall -Q add foo | ||
Greg Ward
|
r8818 | cd foo | ||
echo foo > foo.txt | ||||
Greg Ward
|
r8819 | cvscall -Q add foo.txt | ||
Greg Ward
|
r8821 | cvsci -m "add foo.txt" foo.txt | ||
Greg Ward
|
r8818 | |||
cd ../.. | ||||
rm -rf cvsworktmp | ||||
Greg Ward
|
r8819 | echo "% checkout #2: create MYBRANCH1 and modify foo.txt on it" | ||
cvscall -Q checkout -d cvswork foo | ||||
Greg Ward
|
r8818 | |||
cd cvswork | ||||
cvscall -q rtag -b -R MYBRANCH1 foo | ||||
Greg Ward
|
r8819 | cvscall -Q update -P -r MYBRANCH1 | ||
Greg Ward
|
r8818 | echo bar > foo.txt | ||
Greg Ward
|
r8821 | cvsci -m "bar" foo.txt | ||
Greg Ward
|
r8818 | echo baz > foo.txt | ||
Greg Ward
|
r8821 | cvsci -m "baz" foo.txt | ||
Greg Ward
|
r8818 | |||
Greg Ward
|
r8819 | echo "% create MYBRANCH1_2 and modify foo.txt some more" | ||
Greg Ward
|
r8818 | cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo | ||
Greg Ward
|
r8819 | cvscall -Q update -P -r MYBRANCH1_2 | ||
Greg Ward
|
r8818 | |||
echo bazzie > foo.txt | ||||
Greg Ward
|
r8821 | cvsci -m "bazzie" foo.txt | ||
Greg Ward
|
r8818 | |||
Greg Ward
|
r8819 | echo "% create MYBRANCH1_1 and modify foo.txt yet again" | ||
Greg Ward
|
r8818 | cvscall -q rtag -b -R MYBRANCH1_1 foo | ||
Greg Ward
|
r8819 | cvscall -Q update -P -r MYBRANCH1_1 | ||
Greg Ward
|
r8818 | |||
echo quux > foo.txt | ||||
Greg Ward
|
r8821 | cvsci -m "quux" foo.txt | ||
Greg Ward
|
r8818 | |||
Greg Ward
|
r8819 | echo "% merge MYBRANCH1 to MYBRANCH1_1" | ||
filterpath cvscall -Q update -P -jMYBRANCH1 | ||||
Greg Ward
|
r8821 | # carefully placed sleep to dodge cvs bug (optimization?) where it | ||
# sometimes ignores a "commit" command if it comes too fast (the -f | ||||
# option in cvsci seems to work for all the other commits in this | ||||
# script) | ||||
sleep 1 | ||||
Greg Ward
|
r8819 | echo xyzzy > foo.txt | ||
Greg Ward
|
r8821 | cvsci -m "merge1+clobber" foo.txt | ||
Greg Ward
|
r8818 | |||
Greg Ward
|
r8819 | echo "% return to trunk and merge MYBRANCH1_2" | ||
cvscall -Q update -P -A | ||||
filterpath cvscall -Q update -P -jMYBRANCH1_2 | ||||
Greg Ward
|
r8821 | cvsci -m "merge2" foo.txt | ||
Greg Ward
|
r8818 | |||
REALCVS=`which cvs` | ||||
Greg Ward
|
r8820 | 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 | ||
chmod +x ../cvs | ||||
PATH=..:${PATH} hg debugcvsps --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/' | ||||
Greg Ward
|
r8818 | |||
cd .. | ||||