Author
Christopher Marshall (christopherlmarshall@yahoo.com)
Raw Notes on CVS: complete branching example
#!/bin/bash
# merge example
CWD=$(pwd)
# create a repository
mkdir CVSROOT
export CVSROOT=${CWD}/CVSROOT
cvs init
# create a project
cd $CWD
mkdir p1
cd ${CWD}/p1
touch A B C
cvs import -m "" p1 vtag rtag
cd $CWD
rm -rf p1
# checkout main working copy, create branch
cd ${CWD}
mkdir main; cd main; cvs checkout p1;
cvs tag -b br1 p1
# checkout branch working copy
cd ${CWD}
mkdir branch; cd branch; cvs checkout -r br1 p1
# add a file to main
cd ${CWD}/main/p1
touch D
cvs add D
cvs commit -m "" D
# add a file to branch
cd ${CWD}/branch/p1
touch E
cvs add E
cvs commit -m "" E
# create a conflict
# alter main one way
cd ${CWD}/main/p1
echo "1" > B
cvs commit -m "1" B
# alter branch another way
cd ${CWD}/branch/p1
echo "2" > B
cvs commit -m "1" B
# tag main
cd ${CWD}/main
cvs tag m1 p1
exit 1
# merge main into branch
cd ${CWD}/branch/p1
cvs update -j m1
cvs commit -m "1"
# merge branch into main
cd ${CWD}/main/p1
cvs update -j br1
cvs commit -m "1"
# test branch
cd ${CWD}
mkdir test; cd test; cvs checkout p1
