filemerge regression in 1.9

Adrian Buehlmann adrian at cadifra.com
Wed Jul 6 04:26:05 CDT 2011


On 2011-07-06 10:52, Idan Kamara wrote:
> Btw this only happens in the 'w' version?

I think the answer is "yes" and it is answered in:

http://groups.google.com/group/thg-dev/browse_thread/thread/c51fe51f392e3cc5

where Steve wrote:

On 2011-07-06 06:06, Steve Borho wrote:
> On Tue, Jul 5, 2011 at 10:13 PM, Steve Borho <steve at borho.org> wrote:
>> https://bitbucket.org/tortoisehg/thg/issue/891
>>
>> Apparently Mercurial 1.9 will no longer launch external merge tools
>> when called from thgw.exe (which has no console, and thus no
>> stdout/stderr file handles).
>>
>> --
>> Steve Borho
>>
> 
> FYI: I've found I can debug this problem by running:  pythonw thg resolve
> 
> This opens thg with the "Windows" (non-console) version of python and
> correctly models the situation of having no valid sys.stdout, stderr
> file handles.
> 
> This patch to the thg script makes the resolve tool work, but it also
> makes my skin crawl.
> 
> @@ -77,6 +77,9 @@
>      mystderr = cStringIO.StringIO()
>      origstderr = sys.stderr
>      sys.stderr = mystderr
> +    sys.stdout = cStringIO.StringIO()
> +    sys.__stdout__ = sys.stdout
> +    sys.__stderr__ = sys.stderr
>      ret = 0
>      try:
>          ret = tortoisehg.hgqt.run.dispatch(sys.argv[1:])
> 


TortoiseHg installs two versions of the front-end script on Windows:
thgw.exe and thg.exe

thgw.exe is called from the "shell" (Windows jargon), which is explorer.exe
on Windows (the desktop GUI).

TortoiseHg installs a so-called "shell extension" which allows to start
thgw.exe via a context menu shown by explorer.exe.

thgw.exe has no console.


More information about the Mercurial-devel mailing list