Show More
@@ -35,6 +35,9 b' from . import (' | |||||
35 |
|
35 | |||
36 | urlreq = util.urlreq |
|
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 | samplehgrcs = { |
|
41 | samplehgrcs = { | |
39 | 'user': |
|
42 | 'user': | |
40 | """# example user config (see 'hg help config' for more info) |
|
43 | """# example user config (see 'hg help config' for more info) | |
@@ -1146,15 +1149,19 b' class ui(object):' | |||||
1146 |
|
1149 | |||
1147 | return t |
|
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 | '''execute shell command with appropriate output stream. command |
|
1154 | '''execute shell command with appropriate output stream. command | |
1151 | output will be redirected if fout is not stdout. |
|
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 | out = self.fout |
|
1159 | out = self.fout | |
1154 | if any(s[1] for s in self._bufferstates): |
|
1160 | if any(s[1] for s in self._bufferstates): | |
1155 | out = self |
|
1161 | out = self | |
1156 | return util.system(cmd, environ=environ, cwd=cwd, onerr=onerr, |
|
1162 | with self.timeblockedsection(blockedtag): | |
1157 | errprefix=errprefix, out=out) |
|
1163 | return util.system(cmd, environ=environ, cwd=cwd, onerr=onerr, | |
|
1164 | errprefix=errprefix, out=out) | |||
1158 |
|
1165 | |||
1159 | def traceback(self, exc=None, force=False): |
|
1166 | def traceback(self, exc=None, force=False): | |
1160 | '''print exception traceback if traceback printing enabled or forced. |
|
1167 | '''print exception traceback if traceback printing enabled or forced. |
General Comments 0
You need to be logged in to leave comments.
Login now