##// END OF EJS Templates
commandserver: send raw progress information to message channel...
Yuya Nishihara -
r40630:234c2d8c default
parent child Browse files
Show More
@@ -93,7 +93,8 b' class channeledmessage(object):'
93
93
94 def write(self, data, **opts):
94 def write(self, data, **opts):
95 opts = pycompat.byteskwargs(opts)
95 opts = pycompat.byteskwargs(opts)
96 opts[b'data'] = data
96 if data is not None:
97 opts[b'data'] = data
97 self._cout.write(self._encodefn(opts))
98 self._cout.write(self._encodefn(opts))
98
99
99 def __getattr__(self, attr):
100 def __getattr__(self, attr):
@@ -1675,7 +1675,15 b' class ui(object):'
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'):
@@ -750,9 +750,13 b' structured message channel:'
750 pgid: * (glob)
750 pgid: * (glob)
751 *** runcommand -R repo2 verify
751 *** runcommand -R repo2 verify
752 message: '\xa2DdataTchecking changesets\nDtypeFstatus'
752 message: '\xa2DdataTchecking changesets\nDtypeFstatus'
753 message: '\xa6Ditem@Cpos\xf6EtopicHcheckingEtotal\xf6DtypeHprogressDunit@'
753 message: '\xa2DdataSchecking manifests\nDtypeFstatus'
754 message: '\xa2DdataSchecking manifests\nDtypeFstatus'
755 message: '\xa6Ditem@Cpos\xf6EtopicHcheckingEtotal\xf6DtypeHprogressDunit@'
754 message: '\xa2DdataX0crosschecking files in changesets and manifests\nDtypeFstatus'
756 message: '\xa2DdataX0crosschecking files in changesets and manifests\nDtypeFstatus'
757 message: '\xa6Ditem@Cpos\xf6EtopicMcrosscheckingEtotal\xf6DtypeHprogressDunit@'
755 message: '\xa2DdataOchecking files\nDtypeFstatus'
758 message: '\xa2DdataOchecking files\nDtypeFstatus'
759 message: '\xa6Ditem@Cpos\xf6EtopicHcheckingEtotal\xf6DtypeHprogressDunit@'
756 message: '\xa2DdataX/checked 0 changesets with 0 changes to 0 files\nDtypeFstatus'
760 message: '\xa2DdataX/checked 0 changesets with 0 changes to 0 files\nDtypeFstatus'
757
761
758 >>> from hgclient import checkwith, readchannel, runcommand, stringio
762 >>> from hgclient import checkwith, readchannel, runcommand, stringio
General Comments 0
You need to be logged in to leave comments. Login now