Mercurial > public > mercurial-scm > hg-stable
diff mercurial/ui.py @ 40641:234c2d8c9e48
commandserver: send raw progress information to message channel
This is pretty basic implementation to support GUI progress bar.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 04 Nov 2018 12:51:14 +0900 |
parents | 6f0941f4a184 |
children | c36175456350 |
line wrap: on
line diff
--- a/mercurial/ui.py Sun Nov 04 12:38:49 2018 +0900 +++ b/mercurial/ui.py Sun Nov 04 12:51:14 2018 +0900 @@ -1675,7 +1675,15 @@ All topics should be marked closed by setting pos to None at termination. ''' - if self._progbar is not None: + if getattr(self._fmsgerr, 'structured', False): + # channel for machine-readable output with metadata, just send + # raw information + # TODO: consider porting some useful information (e.g. estimated + # time) from progbar. we might want to support update delay to + # reduce the cost of transferring progress messages. + self._fmsgerr.write(None, type=b'progress', topic=topic, pos=pos, + item=item, unit=unit, total=total) + elif self._progbar is not None: self._progbar.progress(topic, pos, item=item, unit=unit, total=total) if pos is None or not self.configbool('progress', 'debug'):