[PATCH] prevent console windows popping up on windows while updating svn subrepos

dmitry.yakimenko at nokia.com dmitry.yakimenko at nokia.com
Wed May 25 03:16:32 CDT 2011


> > +            startupinfo = subprocess.STARTUPINFO()
> > +            startupinfo.dwFlags |= _STARTF_USESHOWWINDOW
> > +            startupinfo.wShowWindow = _SW_HIDE
> 
> Why don't you use Python's subprocess.STARTF_USESHOWWINDOW and
> subprocess.SW_HIDE

That was my original implementation, but it behaves differently on different versions of Python.  Sometimes it's  subprocess.SW_HIDE and sometimes it's subprocess._ subprocess .SW_HIDE (http://stackoverflow.com/questions/4703983/).  I had to pollute the code with compatibility workarounds first.  Then I noticed that Mercurial already has these constants defined, so I used them.

As Mads Kiilerich suggested it would make more sense to move that into util.py.  I noticed there're two functions popen2 and popen3 which do something similar.  I'm not familiar enough with the Mercurial codebase to make a well evaluated decision if it would be safe to add that extra parameter to popen2 and popen3.

Maybe you could use this patch just as an example and modify the code in the way that seems the most appropriate to you.  I could create a ticket in the bug database and describe how this could be fixed.

Thanks,
Dmitry.


More information about the Mercurial-devel mailing list