History senstive merging?

Mads Kiilerich mads at kiilerich.com
Thu Dec 11 23:37:00 UTC 2008


Neal Becker wrote, On 12/11/2008 07:55 PM:
>> On Thu, 11 Dec 2008 13:33:21 -0500, Neal Becker <ndbecker2 at gmail.com>
>> wrote:
>>     
>>> What do you recommend for history sensitive merging?
>>>
>>> I have a file A, which I copied and modified into B.  Now I want to
>>> take the updates to A and apply them to B.  What 3-way diff tool is
>>> good for this?
>>>       
>> If you used "hg copy A B" to perform the copy this will happen
>> automatically with _any_ merge tool.
>>     
>
> Is hg copy appropriate for the case where A and B are intended to really be different files?  In my case, A & B are 2 python scripts that I want to always be different - yet they have common ancestry and features.
>   

I think hg copy is fine. But I don't think there is any existing tools 
that can use the common ancestor information to do what you ask for.  
(And I don't think it is obvious what such a tool should do.)

For problems like the one you describe I usually use meld on the two 
files. For each difference I choose to ignore the diff or propagate one 
of the versions to the other. Having the common ancestor available is 
nice first time I "merge" the files, but after the first merge there is 
no longer a good common ancestor to use, so a 3-way tool is of limited 
use. YMMV.

(FWIW: Perforce can cherry-pick changes from one file and apply them to 
an other file and keep track of this meta information. Quite often it 
makes a good guess and finds a good common ancestor.)

/Mads
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3435 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20081212/e320f46c/attachment-0003.bin>


More information about the Mercurial mailing list