info-cvs
[Top][All Lists]
Advanced

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

RE: Merge to branch


From: Jim.Hyslop
Subject: RE: Merge to branch
Date: Mon, 5 Jul 2004 10:45:53 -0400

news wrote:
> I have a "main trunk" and a branch "R18". Some changes (on 3 
> files) have been made by programmer on the main trunk but 
> they should have been done in the R18 branch. I'd like the 
> changes made on the three files to be merged (or just copied) 
> to the R18 branch. Of course, the R18 branch should continue 
> to "live" but with the changes (I hope my english is good enougth...).
First of all, your english was more than sufficient to communicate your
problem.

Fixing this will be quite simple. For simplicity, I will assume that there
exist tags 'original' and 'incorrect', which refer to the trunk revisions
immediately prior to the check in, and immediately after the check in. For
example, if the developer had revision 1.2 checked out, modified it, and
checked it in to become rev 1.3 then 'original' would be 1.2, and
'incorrect' would be 1.3.

Since there are only three files involved, you could probably simply use the
numeric revision instead of applying tags.

On the trunk:

cvs up -j incorrect -j original file1 file2 file3
#fix up any conflicts#
cvs di file1 file2 file3
#examine the diff to ensure it looks reasonable#
cvs ci -m "Backing out changes incorrectly checked into the trunk" file1
file2 file3

On the branch:
cvs update -r R18
cvs up -j original -j incorrect file1 file2 file3
#fix up any conflicts#
cvs di file1 file2 file3
#examine the diff to ensure it looks reasonable#
cvs ci file1 file2 file3

Note that the order of the -j parameters is different between the two
commands. The first one does a "negative delta" to back out the changes on
the trunk. The second one does a "positive delta" to apply the changes to
the branch.

-- 
Jim Hyslop
Senior Software Designer
Leitch Technology International Inc. (http://www.leitch.com)
Columnist, C/C++ Users Journal (http://www.cuj.com/experts)





reply via email to

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