This page describes how to perform merges from a Tikiwiki branch to head on CVS.
We will work with CVS BRANCH-1-9 and HEAD in the examples here.
- Assuming you're already experienced with CVS and ready in your BRANCH-1-9 local repository copy, focused on the file you wish to merge from this branch to HEAD. Move the BRANCH-1-9-HEAD tag to the (last) version of file we want to merge:
rtag -a -F -r "version_to_be_tagged" "end_tag" "path/to/the/filename"
cvs rtag -a -F -r "184.108.40.206" "BRANCH-1-9-HEAD" "lib/tiki-js.js"
- Change to CVS HEAD using update command on the file
cvs update -A "lib/tiki-js.js"
Note: Notice we don't specify -r (revision/tag) for update here because HEAD is the default branch and we want update to last commited version of the file. For the other command line parameters explanation enter cvs -H update in your terminal/console.
- Merge changes in a file which occured between tags MERGE-1-9-HEAD and BRANCH-1-9-HEAD (they're on BRANCH-1-9, do you remember ?) from BRANCH-1-9 to HEAD. The syntax is:
cvs update -j "start_tag" -j "end_tag" "path/to/the/filename"
cvs update -j "MERGE-1-9-HEAD" -j "BRANCH-1-9-HEAD" "lib/tiki-js.js"
Note: if it's first merge of that file in the branch and MERGE-1-9-HEAD tag is not available for the file yet, use ROOT-1-9 instead (default)
Now it's possible you will see something like this as a result:
~pre~ ~~#00F: RCS file: /cvsroot/tikiwiki/tiki/lib/tiki-js.js,v + retrieving revision 220.127.116.11 + retrieving revision 18.104.22.168 + Merging differences between 22.214.171.124 and 126.96.36.199 into tiki-js.js~~ + ~~#F00:rcsmerge: warning: conflicts during merge~~ + ok (took 0:01.207) + Info: The following warnings were reported while performing the "cvs update" command. + Info: Tiki HEAD: rcsmerge: warning: conflicts during merge ~/pre~
- Stay cool and don't panic when you see the warning ! The conflicts occur mostly because CVS $Header $ special syntax variable updates with every CVS commit so it appears as edited on both, branch and HEAD at the same place. But don't worry, you can easily fix it by editing the file and removing the lines containing "<<<<<<<", "=" and ">>>>>>>" around it.
<<<<<<< tiki-js.js // $Header: /cvsroot/tikiwiki/tiki/lib/tiki-js.js,v 1.78 2007/08/16 18:33:22 sampaioprimo Exp $ ======= // $Header: /cvsroot/tikiwiki/tiki/lib/tiki-js.js,v 188.8.131.52 2007/08/14 12:43:47 luciash Exp $ >>>>>>> 184.108.40.206
Just leave one $Header $ line which will get auto-updated after you commit (as you already probably know ;))
OK, lets manually fix the remaining (if any) conflicts in your favorite editor now.
- When you're sure no conflicts remain, you can commit the merged file now to HEAD using the "Instant-Auto-Merge from BRANCH-1-9 to HEAD" message.
cvs ci -m "Instant-Auto-Merge from BRANCH-1-9 to HEAD" -l "lib/tiki-js.js"
- After commiting move the tag
MERGE-1-9-to_HEADto your commited file on HEAD to indicate when the file was last merged from branch.
cvs rtag -a -F -r "1.79" "MERGE-BRANCH-1-9-to-HEAD" "lib/tiki-js.js"
- Don't forget about switching back to the branch and do the same tagging indication by moving the tag "MERGE-1-9-HEAD" to the version which was last merged to HEAD !
cvs up -r "BRANCH-1-9" "lib/tiki-js.js"
cvs rtag -a -F -r "220.127.116.11" "MERGE-1-9-HEAD" "lib/tiki-js.js"
And that's it !