info-cvs
[Top][All Lists]
Advanced

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

Re: Overwriting trunk files with specific branch files


From: Derek Price
Subject: Re: Overwriting trunk files with specific branch files
Date: Tue, 30 Aug 2005 09:53:35 -0400
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

It's not really such a brain teaser.  All you are *ever* asking CVS to
do when calculating a diff is to calculate the set of operations which
would transform snapshot A into snapshot B.  All you *ever* add to this
with a merge request is that CVS apply the calculated set of operations
to snapshot C.

When snapshot C happens to be identical to snapshot A, of course
applying the set of operations that would transform snapshot A into
snapshot B results in exactly snapshot B.  This is actually one of the
simpler things you can ask of CVS.  There is not even a chance of conflicts.

Regards,

Derek


Andy Jones wrote:

>Thanks all - I get it now.  
>
>But it +is+ a bit of a brainteaser.  I think I'd be frightened of
>using something that complex on a live system, even if I could check
>the results before I committed them to the repository (which, of
>course, is the case).
>
>Andy.
>
>On 17/08/05, Jim Hyslop <address@hidden> wrote:
>  
>
>>Andy Jones wrote:
>>    
>>
>>>>>cvs co -j HEAD -j t_branchA_tagA module
>>>>>          
>>>>>
>>>Does anyone feel like explainaing how this is not a merge?  I don't get it.
>>>      
>>>
>>It is a merge command, but it does not merge the changes from the
>>branch. It will overwrite the head with the branch.
>>
>>The command as shown is a shortcut to:
>>
>>cvs co module
>>cd module
>>cvs up -j HEAD -j t_branchA_tagA
>>
>>"cvs up -j REVA -j REVB", the merge command, applies the delta between
>>REVB and REVA to the current directory. For a normal merge, REVA and
>>REVB are normally on the same branch, thus you would get the changes
>>from the branch merged into the changes on the trunk, i.e. trunk = trunk
>>+ branch. But, in this case, REVA and REVB refer to the tip revisions on
>>two different branches. The delta is Branch-HEAD, which when added to
>>the HEAD, results in Branch.
>>
>>Mathematically, this can be expressed as:
>>
>>CWD = CWD + Delta
>>
>>where CWD is the current working directory, and Delta is REVB - REVA. In
>>this example CWD is HEAD, REVA is HEAD and REVB is Branch, so the
>>equation becomes:
>>
>>CWD = HEAD + Branch - HEAD
>>
>>which simplifies to
>>
>>CWD = Branch
>>
>>It takes a bit to wrap your head around it, but it does work and do
>>exactly what Christopher wanted.
>>
>>--
>>Jim
>>
>>
>>    
>>
>
>
>_______________________________________________
>Info-cvs mailing list
>address@hidden
>http://lists.nongnu.org/mailman/listinfo/info-cvs
>  
>


-- 
Derek R. Price
CVS Solutions Architect
Ximbiot <http://ximbiot.com>
v: +1 717.579.6168
f: +1 717.234.3125
<mailto:address@hidden>






reply via email to

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