[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Merging trunk changes on to the Branch.

From: Larry Jones
Subject: Re: Merging trunk changes on to the Branch.
Date: Mon, 13 May 2002 12:41:52 -0400 (EDT)

Miller Sally S NPRI writes:
> so Team S does:
> cvs checkout projectname
> cvs rtag -b TeamS_branch
> cvs update -r TeamS_branch
> (they make the minor changes to branch and commits.)
> (Team P will not get these changes as they are on the trunk)
> Now Team P makes some changes on the trunk and commits them.
> Team S wants to update their branch with these changes.
> cvs update -r TeamS_branch
> cvs update -j TeamS_branch -j HEAD
> This seems to kill all the changes that Team S has done.

Exactly.  You've asked CVS to merge all the changes between the most
recent revision on the branch and the most recent revision on the trunk,
which means throwing away all the changes made on the branch.  What you
need is a revision tag on the trunk where the branch starts and then you
can merge the changes between that tag and the HEAD (i.e., only changes
on the trunk, no changes from the branch).  To prevent later errors
caused by trying to merge the same changes multiple times, you'll want
to move that tag on the trunk each time you merge changes.  So, what
Team S should have done is:

        cvs co projectname
        cvs tag TeamS_branch_start
        cvs tag -b TeamS_branch
        cvs up -r TeamS_branch

Note that I've used tag rather than rtag -- if you have a working
directory (or need one), it's much better to use tag so you know for
sure what you're tagging.  You should never use rtag without a -r or -D
option to specify exactly what to tag.

Now, when Team S is ready to merge changes from the trunk, they do:

        cvs tag -F -r HEAD TeamS_branch_merge
        cvs up -j TeamS_branch_start -j TeamS_branch_merge
        cvs tag -F -r TeamS_branch_merge TeamS_branch_start

-Larry Jones

These findings suggest a logical course of action. -- Calvin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]