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