# HG changeset patch # User Idan Kamara # Date 1307534092 -10800 # Node ID e59a7b8f521aa37a9e163851caa63f64d3fe2a54 # Parent 1bdbca0b66041e97a9c49d4e3a5ca1bc67082137 commands: use ui descriptors when reading/writing from stdin/out diff -r 1bdbca0b6604 -r e59a7b8f521a mercurial/commands.py --- a/mercurial/commands.py Wed Jun 15 23:50:33 2011 +0300 +++ b/mercurial/commands.py Wed Jun 08 14:54:52 2011 +0300 @@ -8,7 +8,7 @@ from node import hex, bin, nullid, nullrev, short from lock import release from i18n import _, gettext -import os, re, sys, difflib, time, tempfile, errno +import os, re, difflib, time, tempfile, errno import hg, scmutil, util, revlog, extensions, copies, error, bookmarks import patch, help, url, encoding, templatekw, discovery import archival, changegroup, cmdutil, sshserver, hbisect, hgweb, hgweb.server @@ -336,7 +336,7 @@ if dest == '-': if kind == 'files': raise util.Abort(_('cannot archive plain files to stdout')) - dest = sys.stdout + dest = ui.fout if not prefix: prefix = os.path.basename(repo.root) + '-%h' @@ -1232,7 +1232,7 @@ if text is None: ui.status(_("reading DAG from stdin\n")) - text = sys.stdin.read() + text = ui.fin.read() cl = repo.changelog if len(cl) > 0: @@ -3194,7 +3194,7 @@ if pf == '-': ui.status(_("applying patch from stdin\n")) - pf = sys.stdin + pf = ui.fin else: ui.status(_("applying %s\n") % p) pf = url.open(ui, pf)