comparison mercurial/utils/procutil.py @ 40586:1d3bed7d2923

procutil: import concerns about creationflags on Windows from D1701 I don't have the need anymore for the change in D1701 nor the time to investigate the changes on all supported Windows platforms. I import the stuff I learned on D1701 in the `runbgcommand` so the next people working on it can starts from there. Differential Revision: https://phab.mercurial-scm.org/D5229
author Boris Feld <boris.feld@octobus.net>
date Tue, 06 Nov 2018 11:54:15 +0100
parents 8fab95aa5280
children 246b61bfdc2f
comparison
equal deleted inserted replaced
40585:473510bf0575 40586:1d3bed7d2923
472 if pycompat.iswindows: 472 if pycompat.iswindows:
473 # no fork on Windows, but we can create a detached process 473 # no fork on Windows, but we can create a detached process
474 # https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863.aspx 474 # https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863.aspx
475 # No stdlib constant exists for this value 475 # No stdlib constant exists for this value
476 DETACHED_PROCESS = 0x00000008 476 DETACHED_PROCESS = 0x00000008
477 # Following creation flags might create a console GUI window.
478 # Using subprocess.CREATE_NEW_CONSOLE might helps.
479 # See https://phab.mercurial-scm.org/D1701 for discussion
477 _creationflags = DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP 480 _creationflags = DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP
478 481
479 def runbgcommand(script, env, shell=False, stdout=None, stderr=None): 482 def runbgcommand(script, env, shell=False, stdout=None, stderr=None):
480 '''Spawn a command without waiting for it to finish.''' 483 '''Spawn a command without waiting for it to finish.'''
481 # we can't use close_fds *and* redirect stdin. I'm not sure that we 484 # we can't use close_fds *and* redirect stdin. I'm not sure that we