Skip to content
Snippets Groups Projects
Commit a3fe91b4f6eb authored by Patrick Mezard's avatar Patrick Mezard
Browse files

Change standard streams mode to binary at hg startup

Standard streams are expected to operate in binary mode everywhere, especially with archive, cat, diff and export commands. Rewriting these to separate informational output from binary content is complicated to do and to maintain, nonwithstanding mode switching reliability. Changing all output mode to binary should not have much impact on Windows were stream processing tools are barely used and usually cope with unix style endings.

Streams mode being process wide, the switch is performed in the startup script to avoid polluting existing API users who may have solved this issue already or ignored it at least for the mercurial part.
parent b0ff52ec9b52
No related branches found
No related tags found
No related merge requests found
...@@ -10,4 +10,6 @@ ...@@ -10,4 +10,6 @@
# enable importing on demand to reduce startup time # enable importing on demand to reduce startup time
from mercurial import demandimport; demandimport.enable() from mercurial import demandimport; demandimport.enable()
import sys
import mercurial.util
import mercurial.dispatch import mercurial.dispatch
...@@ -13,2 +15,6 @@ ...@@ -13,2 +15,6 @@
import mercurial.dispatch import mercurial.dispatch
for fp in (sys.stdin, sys.stdout, sys.stderr):
mercurial.util.set_binary(fp)
mercurial.dispatch.run() mercurial.dispatch.run()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment