diff mercurial/utils/procutil.py @ 53033:7a4772e92f23 stable

procutil: fix passing of stdin_bytes to background command When the command where run in the background, the std was closed. So we have to so do some file description juggling to make sure it is passed down. This was affecting automatic clone bundle generation and associated test was added.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 06 Mar 2025 12:23:27 +0100
parents 24ee91ba9aa8
children
line wrap: on
line diff
--- a/mercurial/utils/procutil.py	Thu Mar 06 10:15:00 2025 +0100
+++ b/mercurial/utils/procutil.py	Thu Mar 06 12:23:27 2025 +0100
@@ -743,7 +743,7 @@
             script = b' '.join(shellquote(x) for x in cmd)
         if record_wait is None:
             # double-fork to completely detach from the parent process
-            script = b'( %s ) &' % script
+            script = b'( ( %s ) <&3 3<&- &) 3<&0' % script
             start_new_session = True
         else:
             start_new_session = False