##// END OF EJS Templates
ui: keep the progress bar around when writing if stdout is not a tty
marmoute -
r51339:7f0f3b27 default
parent child Browse files
Show More
@@ -1107,10 +1107,16 b' class ui:'
1107 def fout(self):
1107 def fout(self):
1108 return self._fout
1108 return self._fout
1109
1109
1110 @util.propertycache
1111 def _fout_is_a_tty(self):
1112 self._isatty(self._fout)
1113
1110 @fout.setter
1114 @fout.setter
1111 def fout(self, f):
1115 def fout(self, f):
1112 self._fout = f
1116 self._fout = f
1113 self._fmsgout, self._fmsgerr = _selectmsgdests(self)
1117 self._fmsgout, self._fmsgerr = _selectmsgdests(self)
1118 if '_fout_is_a_tty' in vars(self):
1119 del self._fout_is_a_tty
1114
1120
1115 @property
1121 @property
1116 def ferr(self):
1122 def ferr(self):
@@ -1234,7 +1240,7 b' class ui:'
1234 return
1240 return
1235
1241
1236 # inlined _writenobuf() for speed
1242 # inlined _writenobuf() for speed
1237 if not opts.get('keepprogressbar', False):
1243 if not opts.get('keepprogressbar', self._fout_is_a_tty):
1238 self._progclear()
1244 self._progclear()
1239 msg = b''.join(args)
1245 msg = b''.join(args)
1240
1246
@@ -1273,7 +1279,7 b' class ui:'
1273
1279
1274 def _writenobuf(self, dest, *args: bytes, **opts: _MsgOpts) -> None:
1280 def _writenobuf(self, dest, *args: bytes, **opts: _MsgOpts) -> None:
1275 # update write() as well if you touch this code
1281 # update write() as well if you touch this code
1276 if not opts.get('keepprogressbar', False):
1282 if not opts.get('keepprogressbar', self._fout_is_a_tty):
1277 self._progclear()
1283 self._progclear()
1278 msg = b''.join(args)
1284 msg = b''.join(args)
1279
1285
General Comments 0
You need to be logged in to leave comments. Login now