Comments
Patch
@@ -122,4 +122,4 @@
$ touch $TESTTMP/wait-for-touched
$ sleep 0.2
$ test -f $TESTTMP/touched && echo "SUCCESS Pager is waiting on ltp" || echo "FAIL Pager is waiting on ltp"
- FAIL Pager is waiting on ltp
+ SUCCESS Pager is waiting on ltp
@@ -85,11 +85,16 @@
script = shlex.split(script)
try:
- # connect stdin to devnull to make sure the subprocess can't
- # muck up that stream for mercurial.
+ # connect std* to devnull to make sure the subprocess can't
+ # muck up these stream for mercurial.
+ # Connect all the streams to be more close to Windows behavior
+ # and pager will wait for scripts to end if we don't do that
+ nullrfd = open(os.devnull, 'r')
+ nullwfd = open(os.devnull, 'w')
subprocess.Popen(
- script, shell=shell, stdin=open(os.devnull, 'r'), env=env,
- close_fds=True, **newsession)
+ script, shell=shell, stdin=nullrfd,
+ stdout=nullwfd, stderr=nullwfd,
+ env=env, close_fds=True, **newsession)
finally:
# mission accomplished, this child needs to exit and not
# continue the hg process here.