This page is a draft version for TikiCVSMerge on dev.tw.o : Tikiwiki Development site


This page describes how to perform merges from a Tikiwiki branch to head on CVS.

Command line CVS

We will work with CVS BRANCH-1-9 and HEAD in the examples here.

Step by step CVS Merge

  1. 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"
    Example command
    cvs rtag -a -F -r "" "BRANCH-1-9-HEAD" "lib/tiki-js.js"

  2. Change to CVS HEAD using update command on the file
    Example command
    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.

  3. 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"
    Example command
    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:
    Example result of the command
    ~pre~ ~~#00F: RCS file: /cvsroot/tikiwiki/tiki/lib/tiki-js.js,v + retrieving revision + retrieving revision + Merging differences between and 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~

  4. 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.
    Example of a conflicting diff in a file
    <<<<<<< 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 2007/08/14 12:43:47 luciash Exp $ >>>>>>>

    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.

  5. 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.
    Example command
    cvs ci -m "Instant-Auto-Merge from BRANCH-1-9 to HEAD" -l "lib/tiki-js.js"

  6. After commiting move the tag MERGE-1-9-to_HEAD to your commited file on HEAD to indicate when the file was last merged from branch.
    Example command
    cvs rtag -a -F -r "1.79" "MERGE-BRANCH-1-9-to-HEAD" "lib/tiki-js.js"

  7. 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 !
    Example of switching back to branch
    cvs up -r "BRANCH-1-9" "lib/tiki-js.js"

    Example of tagging
    cvs rtag -a -F -r "" "MERGE-1-9-HEAD" "lib/tiki-js.js"

And that's it !

Merging using Eclipse IDE


Page last modified on Friday 20 September 2019 16:31:07 GMT-0000