Support pager on Windows

Windows does not support pipe|fork, but we can simulate by creating
the pager as a child process, redirecting stdout/in/err appropriately
and then waiting for the child process to terminate after we are
done executing the repo command.

Change-Id: I5dd2bdeb4095e4d93bc678802e53c6d4eda0235b
This commit is contained in:
Renaud Paquay
2016-11-01 15:51:59 -07:00
parent 227ad2ef42
commit e8595e9df7
2 changed files with 38 additions and 3 deletions

View File

@@ -55,7 +55,7 @@ from error import NoSuchProjectError
from error import RepoChangedException
import gitc_utils
from manifest_xml import GitcManifest, XmlManifest
from pager import RunPager
from pager import RunPager, TerminatePager
from wrapper import WrapperPath, Wrapper
from subcmds import all_commands
@@ -542,6 +542,7 @@ def _Main(argv):
print('fatal: %s' % e, file=sys.stderr)
result = 128
TerminatePager()
sys.exit(result)
if __name__ == '__main__':