Skip to content
Snippets Groups Projects
  • Brodie Rao's avatar
    369741ef
    pager: preserve Hg's exit code (and fix Windows support) (issue3225) · 369741ef
    Brodie Rao authored
    This changes how the pager extension invokes the pager. Prior to this change,
    the extension would fork Hg and exec the pager in the parent process. This
    loses Hg exit code, and it doesn't work on Windows.
    
    Now the pager is invoked using the subprocess library, and an atexit handler is
    registered that makes Hg wait for the pager to exit before it exits itself.
    
    Note that if you exit the pager before Hg is done running, you'll get an exit
    code of 255, which is caused by Python blowing up due to a broken pipe. If you
    set pager.quiet=True, you'll get the OS-level return code of 141.
    369741ef
    History
    pager: preserve Hg's exit code (and fix Windows support) (issue3225)
    Brodie Rao authored
    This changes how the pager extension invokes the pager. Prior to this change,
    the extension would fork Hg and exec the pager in the parent process. This
    loses Hg exit code, and it doesn't work on Windows.
    
    Now the pager is invoked using the subprocess library, and an atexit handler is
    registered that makes Hg wait for the pager to exit before it exits itself.
    
    Note that if you exit the pager before Hg is done running, you'll get an exit
    code of 255, which is caused by Python blowing up due to a broken pipe. If you
    set pager.quiet=True, you'll get the OS-level return code of 141.