##// END OF EJS Templates
ui: time calls to ui.system...
Simon Farnsworth -
r30979:fd598149 default
parent child Browse files
Show More
@@ -35,6 +35,9 b' from . import ('
35 35
36 36 urlreq = util.urlreq
37 37
38 # for use with str.translate(None, _keepalnum), to keep just alphanumerics
39 _keepalnum = ''.join(c for c in map(chr, range(256)) if not c.isalnum())
40
38 41 samplehgrcs = {
39 42 'user':
40 43 """# example user config (see 'hg help config' for more info)
@@ -1146,15 +1149,19 b' class ui(object):'
1146 1149
1147 1150 return t
1148 1151
1149 def system(self, cmd, environ=None, cwd=None, onerr=None, errprefix=None):
1152 def system(self, cmd, environ=None, cwd=None, onerr=None, errprefix=None,
1153 blockedtag=None):
1150 1154 '''execute shell command with appropriate output stream. command
1151 1155 output will be redirected if fout is not stdout.
1152 1156 '''
1157 if blockedtag is None:
1158 blockedtag = 'unknown_system_' + cmd.translate(None, _keepalnum)
1153 1159 out = self.fout
1154 1160 if any(s[1] for s in self._bufferstates):
1155 1161 out = self
1156 return util.system(cmd, environ=environ, cwd=cwd, onerr=onerr,
1157 errprefix=errprefix, out=out)
1162 with self.timeblockedsection(blockedtag):
1163 return util.system(cmd, environ=environ, cwd=cwd, onerr=onerr,
1164 errprefix=errprefix, out=out)
1158 1165
1159 1166 def traceback(self, exc=None, force=False):
1160 1167 '''print exception traceback if traceback printing enabled or forced.
General Comments 0
You need to be logged in to leave comments. Login now