##// END OF EJS Templates
util.system: use ui.system() in place of optional ui.fout parameter
Yuya Nishihara -
r23270:41c03b75 default
parent child Browse files
Show More
@@ -226,7 +226,7 b' def dodiff(ui, repo, diffcmd, diffopts, '
226 cmdline = util.shellquote(diffcmd) + ' ' + args
226 cmdline = util.shellquote(diffcmd) + ' ' + args
227
227
228 ui.debug('running %r in %s\n' % (cmdline, tmproot))
228 ui.debug('running %r in %s\n' % (cmdline, tmproot))
229 util.system(cmdline, cwd=tmproot, out=ui.fout)
229 ui.system(cmdline, cwd=tmproot)
230
230
231 for copy_fn, working_fn, mtime in fns_and_mtime:
231 for copy_fn, working_fn, mtime in fns_and_mtime:
232 if os.lstat(copy_fn).st_mtime != mtime:
232 if os.lstat(copy_fn).st_mtime != mtime:
@@ -35,7 +35,7 b' vdiff on hovered and selected revisions.'
35 '''
35 '''
36
36
37 import os
37 import os
38 from mercurial import cmdutil, commands, util, patch, revlog, scmutil
38 from mercurial import cmdutil, commands, patch, revlog, scmutil
39 from mercurial.node import nullid, nullrev, short
39 from mercurial.node import nullid, nullrev, short
40 from mercurial.i18n import _
40 from mercurial.i18n import _
41
41
@@ -349,4 +349,4 b' def view(ui, repo, *etc, **opts):'
349 optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v])
349 optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v])
350 cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc))
350 cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc))
351 ui.debug("running %s\n" % cmd)
351 ui.debug("running %s\n" % cmd)
352 util.system(cmd, out=ui.fout)
352 ui.system(cmd)
@@ -328,10 +328,9 b' the hunk is left unchanged.'
328 f.close()
328 f.close()
329 # Start the editor and wait for it to complete
329 # Start the editor and wait for it to complete
330 editor = ui.geteditor()
330 editor = ui.geteditor()
331 util.system("%s \"%s\"" % (editor, patchfn),
331 ui.system("%s \"%s\"" % (editor, patchfn),
332 environ={'HGUSER': ui.username()},
332 environ={'HGUSER': ui.username()},
333 onerr=util.Abort, errprefix=_("edit failed"),
333 onerr=util.Abort, errprefix=_("edit failed"))
334 out=ui.fout)
335 # Remove comment lines
334 # Remove comment lines
336 patchfp = open(patchfn)
335 patchfp = open(patchfn)
337 ncpatchfp = cStringIO.StringIO()
336 ncpatchfp = cStringIO.StringIO()
@@ -233,13 +233,12 b' class transplanter(object):'
233 fp.close()
233 fp.close()
234
234
235 try:
235 try:
236 util.system('%s %s %s' % (filter, util.shellquote(headerfile),
236 self.ui.system('%s %s %s' % (filter, util.shellquote(headerfile),
237 util.shellquote(patchfile)),
237 util.shellquote(patchfile)),
238 environ={'HGUSER': changelog[1],
238 environ={'HGUSER': changelog[1],
239 'HGREVISION': revlog.hex(node),
239 'HGREVISION': revlog.hex(node),
240 },
240 },
241 onerr=util.Abort, errprefix=_('filter failed'),
241 onerr=util.Abort, errprefix=_('filter failed'))
242 out=self.ui.fout)
243 user, date, msg = self.parselog(file(headerfile))[1:4]
242 user, date, msg = self.parselog(file(headerfile))[1:4]
244 finally:
243 finally:
245 os.unlink(headerfile)
244 os.unlink(headerfile)
@@ -743,9 +743,7 b' def bisect(ui, repo, rev=None, extra=Non'
743 # update state
743 # update state
744 state['current'] = [node]
744 state['current'] = [node]
745 hbisect.save_state(repo, state)
745 hbisect.save_state(repo, state)
746 status = util.system(command,
746 status = ui.system(command, environ={'HG_NODE': hex(node)})
747 environ={'HG_NODE': hex(node)},
748 out=ui.fout)
749 if status == 125:
747 if status == 125:
750 transition = "skip"
748 transition = "skip"
751 elif status == 0:
749 elif status == 0:
@@ -1573,9 +1571,8 b' def config(ui, repo, *values, **opts):'
1573 fp.close()
1571 fp.close()
1574
1572
1575 editor = ui.geteditor()
1573 editor = ui.geteditor()
1576 util.system("%s \"%s\"" % (editor, f),
1574 ui.system("%s \"%s\"" % (editor, f),
1577 onerr=util.Abort, errprefix=_("edit failed"),
1575 onerr=util.Abort, errprefix=_("edit failed"))
1578 out=ui.fout)
1579 return
1576 return
1580
1577
1581 for f in scmutil.rcpath():
1578 for f in scmutil.rcpath():
@@ -402,7 +402,7 b' class cmdalias(object):'
402 return ''
402 return ''
403 cmd = re.sub(r'\$(\d+|\$)', _checkvar, self.definition[1:])
403 cmd = re.sub(r'\$(\d+|\$)', _checkvar, self.definition[1:])
404 cmd = aliasinterpolate(self.name, args, cmd)
404 cmd = aliasinterpolate(self.name, args, cmd)
405 return util.system(cmd, environ=env, out=ui.fout)
405 return ui.system(cmd, environ=env)
406 self.fn = fn
406 self.fn = fn
407 return
407 return
408
408
@@ -301,8 +301,7 b' def _xmerge(repo, mynode, orig, fcd, fco'
301 replace = {'local': a, 'base': b, 'other': c, 'output': out}
301 replace = {'local': a, 'base': b, 'other': c, 'output': out}
302 args = util.interpolate(r'\$', replace, args,
302 args = util.interpolate(r'\$', replace, args,
303 lambda s: util.shellquote(util.localpath(s)))
303 lambda s: util.shellquote(util.localpath(s)))
304 r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env,
304 r = ui.system(toolpath + ' ' + args, cwd=repo.root, environ=env)
305 out=ui.fout)
306 return True, r
305 return True, r
307 return False, 0
306 return False, 0
308
307
@@ -131,7 +131,7 b' def _exthook(ui, repo, name, cmd, args, '
131 cwd = repo.root
131 cwd = repo.root
132 else:
132 else:
133 cwd = os.getcwd()
133 cwd = os.getcwd()
134 r = util.system(cmd, environ=env, cwd=cwd, out=ui.fout)
134 r = ui.system(cmd, environ=env, cwd=cwd)
135
135
136 duration = time.time() - starttime
136 duration = time.time() - starttime
137 ui.log('exthook', 'exthook-%s: %s finished in %0.2f seconds\n',
137 ui.log('exthook', 'exthook-%s: %s finished in %0.2f seconds\n',
@@ -52,7 +52,7 b' class sshpeer(wireproto.wirepeer):'
52 util.shellquote("%s init %s" %
52 util.shellquote("%s init %s" %
53 (_serverquote(remotecmd), _serverquote(self.path))))
53 (_serverquote(remotecmd), _serverquote(self.path))))
54 ui.debug('running %s\n' % cmd)
54 ui.debug('running %s\n' % cmd)
55 res = util.system(cmd, out=ui.fout)
55 res = ui.system(cmd)
56 if res != 0:
56 if res != 0:
57 self._abort(error.RepoError(_("could not create remote repo")))
57 self._abort(error.RepoError(_("could not create remote repo")))
58
58
General Comments 0
You need to be logged in to leave comments. Login now