Boost logo

Boost :

From: Jim.Hyslop (jim.hyslop_at_[hidden])
Date: 2002-01-25 10:24:22


Beman Dawes [SMTP:bdawes_at_[hidden]] wrote:
> At 09:32 AM 1/23/2002, David Abrahams wrote:
>
> > cvs update -j<version>_branch <mod-list>
> >
> >All of your fixes will be merged into your current working copy. When
you
> >commit, they will go into whatever branch you're on, or the main trunk.
>
> That procedure does seem to work once. But if you have to make a second
> change to the same file, the 2nd merge results in conflicts. It tries to
> merge the original change back into the main trunk copy a second time.
>
> I tried several variations on the theme. The problem always come the
> second time I tried do a merge. Does a new branch have to be created
after
> each merge?
No, you just have to specify the -j parameter twice. For example, suppose
you're working on a branch and have merged 1.2.2.3 to the trunk. You have
made further modifications, and want to merge 1.2.2.6 to the trunk. The CVS
command would be:

cvs update -j 1.2.2.3 -j1.2.2.6 [filename]

This tells CVS, in essence: "Merge the difference between version 1.2.2.3
and 1.2.2.6 into the version I currently have checked out."

Here is an example of a sequence of commands you can try in a CVS test
directory (or on a production file for the brave and reckless :-)

[create a file testfile.txt]
cvs add testfile.txt
cvs commit testfile.txt

[modify testfile.txt]
cvs commit testfile.txt
[repeat modify/commit as desired]

[when ready to create branch]
cvs tag -b mybranch testfile.txt [creates the branch tag]
cvs tag mybranch_base testfile.txt [very handy to have a symbolic tag
noting the branch point]
cvs update -r mybranch [switch to the branch]
[modify testfile.txt]
cvs commit testfile.txt
[repeat modify/commit as desired]

[when ready for first merge]
cvs update -A [switch to the trunk]
cvs update -j mybranch testfile.txt [merge changes to the trunk]
[resolve any conflicts, make sure it builds, etc. etc.]
cvs commit -m "Merged from branch to trunk" testfile.txt
cvs update -r mybranch testfile.txt [switch back to the branch]
cvs tag mybranch_last_merge testfile.txt [keep track of the last merge
point]
[merge is complete]

[modify testfile.txt]
cvs commit testfile.txt
[repeat modify/commit as desired]

[when ready for second and subsequent merges]
cvs update -A
cvs update -j mybranch_last_merge -j mybranch testfile.txt
[resolve any conflicts, make sure it builds, etc. etc.]
cvs commit -m "Second merge from branch to trunk" testfile.txt
cvs update -r mybranch testfile.txt
cvs tag -F mybranch_last_merge testfile.txt [-F forces the tag to move; or
create a new tag]
[merge is complete]

-- 
Jim

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk