changeset 23270:41c03b7592ed

util.system: use ui.system() in place of optional ui.fout parameter
author Yuya Nishihara <yuya@tcha.org>
date Sat, 08 Nov 2014 13:06:22 +0900
parents d9d8d2e0f701
children 76302f5ceba4
files hgext/extdiff.py hgext/hgk.py hgext/record.py hgext/transplant.py mercurial/commands.py mercurial/dispatch.py mercurial/filemerge.py mercurial/hook.py mercurial/sshpeer.py
diffstat 9 files changed, 19 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/extdiff.py	Sat Nov 08 12:57:42 2014 +0900
+++ b/hgext/extdiff.py	Sat Nov 08 13:06:22 2014 +0900
@@ -226,7 +226,7 @@
         cmdline = util.shellquote(diffcmd) + ' ' + args
 
         ui.debug('running %r in %s\n' % (cmdline, tmproot))
-        util.system(cmdline, cwd=tmproot, out=ui.fout)
+        ui.system(cmdline, cwd=tmproot)
 
         for copy_fn, working_fn, mtime in fns_and_mtime:
             if os.lstat(copy_fn).st_mtime != mtime:
--- a/hgext/hgk.py	Sat Nov 08 12:57:42 2014 +0900
+++ b/hgext/hgk.py	Sat Nov 08 13:06:22 2014 +0900
@@ -35,7 +35,7 @@
 '''
 
 import os
-from mercurial import cmdutil, commands, util, patch, revlog, scmutil
+from mercurial import cmdutil, commands, patch, revlog, scmutil
 from mercurial.node import nullid, nullrev, short
 from mercurial.i18n import _
 
@@ -349,4 +349,4 @@
     optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v])
     cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc))
     ui.debug("running %s\n" % cmd)
-    util.system(cmd, out=ui.fout)
+    ui.system(cmd)
--- a/hgext/record.py	Sat Nov 08 12:57:42 2014 +0900
+++ b/hgext/record.py	Sat Nov 08 13:06:22 2014 +0900
@@ -328,10 +328,9 @@
                     f.close()
                     # Start the editor and wait for it to complete
                     editor = ui.geteditor()
-                    util.system("%s \"%s\"" % (editor, patchfn),
-                            environ={'HGUSER': ui.username()},
-                            onerr=util.Abort, errprefix=_("edit failed"),
-                            out=ui.fout)
+                    ui.system("%s \"%s\"" % (editor, patchfn),
+                              environ={'HGUSER': ui.username()},
+                              onerr=util.Abort, errprefix=_("edit failed"))
                     # Remove comment lines
                     patchfp = open(patchfn)
                     ncpatchfp = cStringIO.StringIO()
--- a/hgext/transplant.py	Sat Nov 08 12:57:42 2014 +0900
+++ b/hgext/transplant.py	Sat Nov 08 13:06:22 2014 +0900
@@ -233,13 +233,12 @@
         fp.close()
 
         try:
-            util.system('%s %s %s' % (filter, util.shellquote(headerfile),
-                                   util.shellquote(patchfile)),
-                        environ={'HGUSER': changelog[1],
-                                 'HGREVISION': revlog.hex(node),
-                                 },
-                        onerr=util.Abort, errprefix=_('filter failed'),
-                        out=self.ui.fout)
+            self.ui.system('%s %s %s' % (filter, util.shellquote(headerfile),
+                                         util.shellquote(patchfile)),
+                           environ={'HGUSER': changelog[1],
+                                    'HGREVISION': revlog.hex(node),
+                                    },
+                           onerr=util.Abort, errprefix=_('filter failed'))
             user, date, msg = self.parselog(file(headerfile))[1:4]
         finally:
             os.unlink(headerfile)
--- a/mercurial/commands.py	Sat Nov 08 12:57:42 2014 +0900
+++ b/mercurial/commands.py	Sat Nov 08 13:06:22 2014 +0900
@@ -743,9 +743,7 @@
                 # update state
                 state['current'] = [node]
                 hbisect.save_state(repo, state)
-                status = util.system(command,
-                                     environ={'HG_NODE': hex(node)},
-                                     out=ui.fout)
+                status = ui.system(command, environ={'HG_NODE': hex(node)})
                 if status == 125:
                     transition = "skip"
                 elif status == 0:
@@ -1573,9 +1571,8 @@
             fp.close()
 
         editor = ui.geteditor()
-        util.system("%s \"%s\"" % (editor, f),
-                    onerr=util.Abort, errprefix=_("edit failed"),
-                    out=ui.fout)
+        ui.system("%s \"%s\"" % (editor, f),
+                  onerr=util.Abort, errprefix=_("edit failed"))
         return
 
     for f in scmutil.rcpath():
--- a/mercurial/dispatch.py	Sat Nov 08 12:57:42 2014 +0900
+++ b/mercurial/dispatch.py	Sat Nov 08 13:06:22 2014 +0900
@@ -402,7 +402,7 @@
                         return ''
                 cmd = re.sub(r'\$(\d+|\$)', _checkvar, self.definition[1:])
                 cmd = aliasinterpolate(self.name, args, cmd)
-                return util.system(cmd, environ=env, out=ui.fout)
+                return ui.system(cmd, environ=env)
             self.fn = fn
             return
 
--- a/mercurial/filemerge.py	Sat Nov 08 12:57:42 2014 +0900
+++ b/mercurial/filemerge.py	Sat Nov 08 13:06:22 2014 +0900
@@ -301,8 +301,7 @@
         replace = {'local': a, 'base': b, 'other': c, 'output': out}
         args = util.interpolate(r'\$', replace, args,
                                 lambda s: util.shellquote(util.localpath(s)))
-        r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env,
-                        out=ui.fout)
+        r = ui.system(toolpath + ' ' + args, cwd=repo.root, environ=env)
         return True, r
     return False, 0
 
--- a/mercurial/hook.py	Sat Nov 08 12:57:42 2014 +0900
+++ b/mercurial/hook.py	Sat Nov 08 13:06:22 2014 +0900
@@ -131,7 +131,7 @@
         cwd = repo.root
     else:
         cwd = os.getcwd()
-    r = util.system(cmd, environ=env, cwd=cwd, out=ui.fout)
+    r = ui.system(cmd, environ=env, cwd=cwd)
 
     duration = time.time() - starttime
     ui.log('exthook', 'exthook-%s: %s finished in %0.2f seconds\n',
--- a/mercurial/sshpeer.py	Sat Nov 08 12:57:42 2014 +0900
+++ b/mercurial/sshpeer.py	Sat Nov 08 13:06:22 2014 +0900
@@ -52,7 +52,7 @@
                 util.shellquote("%s init %s" %
                     (_serverquote(remotecmd), _serverquote(self.path))))
             ui.debug('running %s\n' % cmd)
-            res = util.system(cmd, out=ui.fout)
+            res = ui.system(cmd)
             if res != 0:
                 self._abort(error.RepoError(_("could not create remote repo")))