Patchwork [2,of,4] simplemerge: obtain stdout from ui

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 8, 2016, 2:47 p.m.
Message ID <e9cec005658fc72458c4.1478616446@mimosa>
Download mbox | patch
Permalink /patch/17403/
State Accepted
Headers show

Comments

Yuya Nishihara - Nov. 8, 2016, 2:47 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1476968990 -32400
#      Thu Oct 20 22:09:50 2016 +0900
# Node ID e9cec005658fc72458c49965e8c52b4b5ede0309
# Parent  3f64af3f78a8dffe9b241904fedff33e22d4c8eb
simplemerge: obtain stdout from ui

This will help Python 3 porting.

Patch

diff --git a/mercurial/simplemerge.py b/mercurial/simplemerge.py
--- a/mercurial/simplemerge.py
+++ b/mercurial/simplemerge.py
@@ -19,7 +19,6 @@ 
 from __future__ import absolute_import
 
 import os
-import sys
 
 from .i18n import _
 from . import (
@@ -441,7 +440,7 @@  def simplemerge(ui, local, base, other, 
         opener = scmutil.opener(os.path.dirname(local))
         out = opener(os.path.basename(local), "w", atomictemp=True)
     else:
-        out = sys.stdout
+        out = ui.fout
 
     m3 = Merge3Text(basetext, localtext, othertext)
     extrakwargs = {