[PATCH 2 of 2] internal merge tool not working for merge-pattern in hgrc: fix

Dov Feldstern dfeldstern at fastimap.com
Thu Apr 3 18:55:49 CDT 2008


Matt Mackall wrote:
> On Fri, 2008-04-04 at 02:41 +0300, Dov Feldstern wrote:
>> # HG changeset patch
>> # User Dov Feldstern <dfeldstern at fastimap.com>
>> # Date 1207264913 -10800
>> # Node ID 448f5b405498937b7554fd0989dbbe8875227089
>> # Parent  00dc8ed8af76d7490b48daffddd8c2657d7a93ca
>> use internal merge tool when specified for a merge-pattern in hgrc
>>
>> It is possible to specify in the hgrc file that one of the internal merge
>> tools (internal:fail, internal:local or internal:other) be used for
>> performing merges on files matching a given pattern. However, this setting
>> is not being acted upon (the merge tool is not found). This patch fixes that.
>>
>> diff -r 00dc8ed8af76 -r 448f5b405498 mercurial/filemerge.py
>> --- a/mercurial/filemerge.py    Fri Apr 04 02:20:58 2008 +0300
>> +++ b/mercurial/filemerge.py    Fri Apr 04 02:21:53 2008 +0300
>> @@ -16,6 +16,8 @@
>>       return ui.configbool("merge-tools", tool + "." + part, default)
>>
>>   def _findtool(ui, tool):
>> +    if tool in ("internal:fail", "internal:local", "internal:other"):
>> +        return tool
> 
> Your indenting is inconsistent here.
> 

Oops.. sorry.

> How about 'if tool.startswith("internal:")'? Other than that, this is a
> perfectly good fix.
> 

I first tried that, but then things don't work exactly right if you chose 
"internal:bla" --- it falls back to the internal:merge, but without an error 
indicating that "internal:bla" was not found...

Dov



More information about the Mercurial-devel mailing list