comparison mercurial/ui.py @ 40594: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
comparison
equal deleted inserted replaced
40593:6f0941f4a184 40594:234c2d8c9e48
1673 Multiple nested topics may be active at a time. 1673 Multiple nested topics may be active at a time.
1674 1674
1675 All topics should be marked closed by setting pos to None at 1675 All topics should be marked closed by setting pos to None at
1676 termination. 1676 termination.
1677 ''' 1677 '''
1678 if self._progbar is not None: 1678 if getattr(self._fmsgerr, 'structured', False):
1679 # channel for machine-readable output with metadata, just send
1680 # raw information
1681 # TODO: consider porting some useful information (e.g. estimated
1682 # time) from progbar. we might want to support update delay to
1683 # reduce the cost of transferring progress messages.
1684 self._fmsgerr.write(None, type=b'progress', topic=topic, pos=pos,
1685 item=item, unit=unit, total=total)
1686 elif self._progbar is not None:
1679 self._progbar.progress(topic, pos, item=item, unit=unit, 1687 self._progbar.progress(topic, pos, item=item, unit=unit,
1680 total=total) 1688 total=total)
1681 if pos is None or not self.configbool('progress', 'debug'): 1689 if pos is None or not self.configbool('progress', 'debug'):
1682 return 1690 return
1683 1691