mercurial/ui.py
changeset 40641 234c2d8c9e48
parent 40640 6f0941f4a184
child 40649 c36175456350
--- 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'):