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
# br1 is the branch name
# and br1-1 is the name of the tag at the branch point (the branchbasetag)
cd ${CWD}
mkdir main; cd main; cvs checkout p1;
cvs tag -b br1 p1
cvs tag br1-root p1

# checkout branch working copy
cd ${CWD}
mkdir branch; cd branch; cvs checkout -r br1 p1

   # make changes to branch
   cd ${CWD}/branch/p1
   rm C; cvs remove C;
   touch E; cvs add E;
   cvs commit -m "1"

   # make a change to main
   cd ${CWD}/main/p1
   rm B; cvs remove B;
   touch D; cvs add D;
   cvs commit -m "1"

   # tag main -> branch merge point
   cd ${CWD}/main
   cvs tag tmb1-1 p1

   # merge main into branch
   cd ${CWD}/branch/p1
   cvs update -j br1-root -j tmb1-1
   cvs commit -m "1"

   # make more changes to main
   cd ${CWD}/main/p1
   touch F; cvs add F; echo "1" > D
   cvs commit -m "1"

   # tag main -> branch merge point
   cd ${CWD}/main
   cvs tag tmb1-2 p1

   # merge main into branch
   cd ${CWD}/branch/p1
   cvs update -j tmb1-1 -j tmb1-2
   cvs commit -m "1"

hopeless_linux: RawNotes/cvs branching example3 (last modified 2007-07-01 16:01:00)